Ent movement fixed.
This commit is contained in:
@@ -86,21 +86,21 @@ void entityWalk(entity_t *entity, const entitydir_t direction) {
|
||||
// TODO: Map bounds in way?
|
||||
|
||||
// Entity in way?
|
||||
// entity_t *start = GAME.overworld.map.entities;
|
||||
// entity_t *end = start + MAP_ENTITY_COUNT;
|
||||
// while(start < end) {
|
||||
// if(
|
||||
// start == entity ||
|
||||
// entity->type == ENTITY_TYPE_NULL ||
|
||||
// start->position.x != newX ||
|
||||
// start->position.y != newY
|
||||
// ) {
|
||||
// start++;
|
||||
// continue;
|
||||
// }
|
||||
entity_t *start = 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;
|
||||
}
|
||||
|
||||
// return;// Blocked
|
||||
// }
|
||||
return;// Blocked
|
||||
} while(start < &ENTITIES[ENTITY_COUNT]);
|
||||
|
||||
// Move.
|
||||
entity->position.x = newX;
|
||||
|
||||
Reference in New Issue
Block a user