Fix PSP Deadzones
This commit is contained in:
@@ -81,21 +81,15 @@ void entityWalk(entity_t *entity, const entitydir_t direction) {
|
||||
// TODO: Map bounds in way?
|
||||
|
||||
// Entity in way?
|
||||
entity_t *start = ENTITIES;
|
||||
entity_t *other = ENTITIES;
|
||||
do {
|
||||
if(
|
||||
start == entity ||
|
||||
entity->type == ENTITY_TYPE_NULL ||
|
||||
start->position.x != newX ||
|
||||
start->position.y != newY ||
|
||||
start->position.z != entity->position.z
|
||||
) {
|
||||
start++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(other == entity) continue;
|
||||
if(other->type == ENTITY_TYPE_NULL) continue;
|
||||
if(other->position.x != newX) continue;
|
||||
if(other->position.y != newY) continue;
|
||||
if(other->position.z != entity->position.z) continue;
|
||||
return;// Blocked
|
||||
} while(start < &ENTITIES[ENTITY_COUNT]);
|
||||
} while(++other, other < &ENTITIES[ENTITY_COUNT]);
|
||||
|
||||
// Move.
|
||||
entity->position.x = newX;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "npc.h"
|
||||
|
||||
typedef enum {
|
||||
ENTITY_TYPE_NULL,
|
||||
ENTITY_TYPE_NULL = 0,
|
||||
|
||||
ENTITY_TYPE_PLAYER,
|
||||
ENTITY_TYPE_NPC,
|
||||
|
||||
Reference in New Issue
Block a user