This commit is contained in:
aozhiwei 2019-05-15 15:14:12 +08:00
parent bad1bba6c2
commit 2800019563
3 changed files with 3 additions and 0 deletions

View File

@ -94,6 +94,7 @@ void Obstacle::FillMFObjectFull(cs::MFObjectFull* full_data)
p->set_is_door(is_door);
if (is_door) {
p->set_door_id(door_id);
p->set_door_open_times(door_open_times);
p->set_door_old_state((int)door_state);
p->set_door_new_state((int)door_state);
p->set_door_house_uniid(door_house_uniid);

View File

@ -30,6 +30,7 @@ class Obstacle : public Entity
bool is_door = false;
int door_id = 0;
int door_open_times = 0;
DoorState_e door_state = DoorStateClose;
Building* building = nullptr;
int door_house_uniid = 0;

View File

@ -586,6 +586,7 @@ void Player::ObstacleInteraction(Obstacle* entity)
entity->pos = Vector2D(entity->building->pos.x + entity->door_state0->x() - entity->building->meta->i->tilewidth() / 2.0,
entity->building->pos.y + entity->door_state0->y() - entity->building->meta->i->tileheight() / 2.0);
}
++entity->door_open_times;
entity->RecalcSelfCollider();
room->TouchHumanList(a8::XParams(),
[entity] (Human* hum, a8::XParams& param) -> bool