1
This commit is contained in:
parent
700578af9c
commit
807d90a745
@ -4372,14 +4372,18 @@ void Human::DoGetOnWithLoot(Loot* entity)
|
|||||||
if (GetCar()) {
|
if (GetCar()) {
|
||||||
GetCar()->GetDown(this);
|
GetCar()->GetDown(this);
|
||||||
}
|
}
|
||||||
car_ = room->CreateCar(
|
Car* car = room->CreateCar(
|
||||||
this,
|
this,
|
||||||
entity->GetEntityUniId(),
|
entity->GetEntityUniId(),
|
||||||
item_meta,
|
item_meta,
|
||||||
GetPos()
|
GetPos()
|
||||||
);
|
);
|
||||||
car_->GetOn(this);
|
car->GetOn(this);
|
||||||
|
room->TakeOnCarObject(entity->GetEntityUniId());
|
||||||
room->NotifyUiUpdate();
|
room->NotifyUiUpdate();
|
||||||
|
#ifdef DEBUG
|
||||||
|
a8::XPrintf("DoGetOnWithLoot uniid:%d car_uniid:%d\n", {car->GetEntityUniId(), car->car_uniid});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::DoGetOnWithCar(Car* car)
|
void Human::DoGetOnWithCar(Car* car)
|
||||||
|
@ -127,14 +127,14 @@ void Room::Update(int delta_time)
|
|||||||
|
|
||||||
elapsed_time_ += delta_time;
|
elapsed_time_ += delta_time;
|
||||||
while (elapsed_time_ >= 50) {
|
while (elapsed_time_ >= 50) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG1
|
||||||
long long begin_tick = a8::XGetTickCount();
|
long long begin_tick = a8::XGetTickCount();
|
||||||
long long end_tick = a8::XGetTickCount();
|
long long end_tick = a8::XGetTickCount();
|
||||||
#endif
|
#endif
|
||||||
if (GetFrameNo() % 2 == 0) {
|
if (GetFrameNo() % 2 == 0) {
|
||||||
UpdateGas();
|
UpdateGas();
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG1
|
||||||
end_tick = a8::XGetTickCount();
|
end_tick = a8::XGetTickCount();
|
||||||
if (a8::XGetTickCount() - begin_tick > 1000) {
|
if (a8::XGetTickCount() - begin_tick > 1000) {
|
||||||
abort();
|
abort();
|
||||||
@ -144,7 +144,7 @@ void Room::Update(int delta_time)
|
|||||||
for (auto& pair : moveable_hash_) {
|
for (auto& pair : moveable_hash_) {
|
||||||
pair.second->Update(50);
|
pair.second->Update(50);
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG1
|
||||||
end_tick = a8::XGetTickCount();
|
end_tick = a8::XGetTickCount();
|
||||||
if (a8::XGetTickCount() - begin_tick > 1000) {
|
if (a8::XGetTickCount() - begin_tick > 1000) {
|
||||||
abort();
|
abort();
|
||||||
@ -154,7 +154,7 @@ void Room::Update(int delta_time)
|
|||||||
if (GetFrameNo() % 2 == 0) {
|
if (GetFrameNo() % 2 == 0) {
|
||||||
SyncFrameData();
|
SyncFrameData();
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG1
|
||||||
end_tick = a8::XGetTickCount();
|
end_tick = a8::XGetTickCount();
|
||||||
if (a8::XGetTickCount() - begin_tick > 1000) {
|
if (a8::XGetTickCount() - begin_tick > 1000) {
|
||||||
abort();
|
abort();
|
||||||
@ -552,7 +552,7 @@ Car* Room::CreateCar(Human* driver,
|
|||||||
MetaData::Equip* item_meta,
|
MetaData::Equip* item_meta,
|
||||||
const a8::Vec2& pos)
|
const a8::Vec2& pos)
|
||||||
{
|
{
|
||||||
Car* car = EntityFactory::Instance()->MakeCar(car_uniid);
|
Car* car = EntityFactory::Instance()->MakeCar(AllocUniid());
|
||||||
car->car_uniid = car_uniid;
|
car->car_uniid = car_uniid;
|
||||||
car->meta = item_meta;
|
car->meta = item_meta;
|
||||||
car->room = this;
|
car->room = this;
|
||||||
@ -564,8 +564,8 @@ Car* Room::CreateCar(Human* driver,
|
|||||||
car->Initialize();
|
car->Initialize();
|
||||||
AddToEntityHash(car);
|
AddToEntityHash(car);
|
||||||
grid_service->AddCar(car);
|
grid_service->AddCar(car);
|
||||||
car->BroadcastFullState(this);
|
|
||||||
car->RefreshView();
|
car->RefreshView();
|
||||||
|
car->BroadcastFullState(this);
|
||||||
return car;
|
return car;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user