- [FIX] Si canviem d'habiació petava per continuar el update de abans
- [FIX] La porta YN no funcionava - [CHG] El heroi ex mes avant en la porta d'entrada
This commit is contained in:
@@ -18,6 +18,7 @@ namespace actor
|
||||
actor_t *dirty = nullptr;
|
||||
actor_t *selected = nullptr;
|
||||
actor_t *picked = nullptr;
|
||||
static bool room_changed = false;
|
||||
|
||||
actor_t *getFirst()
|
||||
{
|
||||
@@ -669,11 +670,11 @@ namespace actor
|
||||
}
|
||||
|
||||
// Si ja havem atravesat la porta, ens movem a la porta de l'altra costat
|
||||
// [TODO] que es moga a l'habitació que toca!!!
|
||||
if (act->pos.x<min.x-4) {
|
||||
room::load(room::getExit(XN));
|
||||
act->pos.x = room::getMax().x+3;
|
||||
act->pos.x = room::getMax().x-4;
|
||||
act->pos.z = room::getDoor(XP)*4;
|
||||
room_changed = true;
|
||||
}
|
||||
|
||||
actor::setDirty(act);
|
||||
@@ -700,6 +701,7 @@ namespace actor
|
||||
room::load(room::getExit(XP));
|
||||
act->pos.x = room::getMin().x-3;
|
||||
act->pos.z = room::getDoor(XN)*4;
|
||||
room_changed = true;
|
||||
}
|
||||
|
||||
actor::setDirty(act);
|
||||
@@ -710,7 +712,7 @@ namespace actor
|
||||
if (act->push & PUSH_YN) {
|
||||
act->pos.y--;
|
||||
actor::actor_t *other = actor::get_collision(act);
|
||||
if (other || ( act->pos.y<min.y && ( !(room::getDoors()&DOOR_YN) || (act->pos.x!=28) || (act->pos.z!=room::getDoor(XN)*4) || !(act->flags&FLAG_HERO) ) ))
|
||||
if (other || ( act->pos.y<min.y && ( !(room::getDoors()&DOOR_YN) || (act->pos.x!=28) || (act->pos.z!=room::getDoor(YN)*4) || !(act->flags&FLAG_HERO) ) ))
|
||||
{
|
||||
if (other) act->push |= push(other, PUSH_YN);
|
||||
act->pos.y++;
|
||||
@@ -724,8 +726,9 @@ namespace actor
|
||||
|
||||
if (act->pos.y<min.y-4) {
|
||||
room::load(room::getExit(YN));
|
||||
act->pos.y = room::getMax().y+3;
|
||||
act->pos.y = room::getMax().y-4;
|
||||
act->pos.z = room::getDoor(YP)*4;
|
||||
room_changed = true;
|
||||
}
|
||||
|
||||
actor::setDirty(act);
|
||||
@@ -752,6 +755,7 @@ namespace actor
|
||||
room::load(room::getExit(YP));
|
||||
act->pos.y = room::getMin().y-3;
|
||||
act->pos.z = room::getDoor(YN)*4;
|
||||
room_changed = true;
|
||||
}
|
||||
|
||||
actor::setDirty(act);
|
||||
@@ -768,6 +772,7 @@ namespace actor
|
||||
room::load(room::getExit(ZN));
|
||||
act->pos.z = room::getMax().z;
|
||||
actor::setDirty(act);
|
||||
room_changed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -858,7 +863,8 @@ namespace actor
|
||||
|
||||
//act->push = PUSH_NONE;
|
||||
|
||||
if (update_all && next) update(next);
|
||||
if (!room_changed && update_all && next) update(next);
|
||||
room_changed = false;
|
||||
}
|
||||
|
||||
void updateEditor(actor_t *act, const bool update_all)
|
||||
|
||||
Reference in New Issue
Block a user