diff --git a/source/actor.cpp b/source/actor.cpp index dad5e0a..ff7947d 100644 --- a/source/actor.cpp +++ b/source/actor.cpp @@ -277,10 +277,10 @@ namespace actor if (act->react_mask) { // Si topetem en una vora de l'habitació, s'acabat el bot - if (act->pos.x>max.x || act->pos.xpos.y>max.y || act->pos.yreact_push=8; + if (act->pos.x>max.x || act->pos.xpos.y>max.y || act->pos.yreact_push=9; // Si encara està botant (react_push < 8)... - if (act->react_push<8) + if (act->react_push<9) { act->pos.z++; // seguim pujant act->react_push++; // augmentem el comptador de bot @@ -355,28 +355,8 @@ namespace actor if (act->flags & FLAG_ORIENTABLE) act->orient = act->mov_push; } - void updateReactive(actor_t *act) - { - if (act->push & act->react_mask) - { - actor_t *other = nullptr; - - if (act->push == PUSH_XP) { act->pos.x-=2; other = get_collision(act); act->pos.x+=2; } - else if (act->push == PUSH_XN) { act->pos.x++; other = get_collision(act); act->pos.x--; } - else if (act->push == PUSH_YP) { act->pos.y--; other = get_collision(act); act->pos.y++; } - else if (act->push == PUSH_YN) { act->pos.y++; other = get_collision(act); act->pos.y--; } - else if (act->push == PUSH_ZN) { act->pos.z++; other = get_collision(act); act->pos.z--; } - - if (other) { - other->push |= act->react_push; - } - } - } - void updatePush(actor_t *act) { - if (act->flags & FLAG_REACTIVE) { updateReactive(act); return; } - vec3_t min = room::getMin(); vec3_t max = room::getMax(); @@ -524,7 +504,7 @@ namespace actor // ...i encara està baix... if (is_above(act, act->below)) { // ...li pase a ell el push, neteje el meu flag, canvie direcció si pertoca i me ane - uint8_t result = push(act->below, PUSH_ZN); + act->push |= push(act->below, PUSH_ZN); act->push &= ~PUSH_ZN; if (act->flags & FLAG_MOVING) changeMoving(act); return; @@ -544,7 +524,7 @@ namespace actor act->below = below; below->above = act; // ... i li passem el push, netejem el meu flag i gonnem - uint8_t result = push(act->below, PUSH_ZN); + act->push |= push(act->below, PUSH_ZN); act->push &= ~PUSH_ZN; if (act->flags & FLAG_MOVING) changeMoving(act); return; @@ -554,6 +534,7 @@ namespace actor if (act->flags&FLAG_HERO && (act->pos.x>max.x || act->pos.xpos.y>max.y || act->pos.ypush &= ~PUSH_ZN; act->pos.z--; actor::setDirty(act); }