2016-04-29 14:53:19 +00:00
|
|
|
#include <game/mapitems.h>
|
|
|
|
|
|
|
|
bool IsValidGameTile(int Index)
|
|
|
|
{
|
2016-04-30 09:02:00 +00:00
|
|
|
return (
|
|
|
|
Index == TILE_AIR
|
2016-04-29 14:53:19 +00:00
|
|
|
|| (Index >= TILE_SOLID && Index <= TILE_NOLASER)
|
|
|
|
|| Index == TILE_THROUGH
|
|
|
|
|| Index == TILE_FREEZE
|
|
|
|
|| (Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE)
|
|
|
|
|| (Index >= TILE_WALLJUMP && Index <= TILE_SOLO_END)
|
|
|
|
|| (Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA)
|
|
|
|
|| (Index >= TILE_CP && Index <= TILE_THROUGH_DIR)
|
|
|
|
|| (Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM)
|
|
|
|
|| (Index >= TILE_NPC_END && Index <= TILE_NPH_END)
|
|
|
|
|| (Index >= TILE_NPC_START && Index <= TILE_NPH_START)
|
|
|
|
|| (Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2)
|
2016-04-30 09:02:00 +00:00
|
|
|
|| IsValidEntity(Index)
|
2016-04-29 14:53:19 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsValidFrontTile(int Index)
|
|
|
|
{
|
2016-04-30 09:02:00 +00:00
|
|
|
return (
|
|
|
|
Index == TILE_AIR
|
2016-04-29 14:53:19 +00:00
|
|
|
|| Index == TILE_DEATH
|
|
|
|
|| (Index >= TILE_NOLASER && Index <= TILE_THROUGH)
|
|
|
|
|| Index == TILE_FREEZE
|
|
|
|
|| (Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE)
|
|
|
|
|| (Index >= TILE_WALLJUMP && Index <= TILE_SOLO_END)
|
|
|
|
|| (Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA)
|
|
|
|
|| (Index >= TILE_CP && Index <= TILE_THROUGH_DIR)
|
|
|
|
|| (Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM)
|
|
|
|
|| (Index >= TILE_NPC_END && Index <= TILE_NPH_END)
|
|
|
|
|| (Index >= TILE_NPC_START && Index <= TILE_NPH_START)
|
2016-04-30 09:02:00 +00:00
|
|
|
|| IsValidEntity(Index)
|
2016-04-29 14:53:19 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsValidEntity(int Index)
|
|
|
|
{
|
2016-04-30 09:02:00 +00:00
|
|
|
Index -= ENTITY_OFFSET;
|
|
|
|
return (
|
|
|
|
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST)
|
|
|
|
|| (Index >= ENTITY_PLASMAE && Index <= ENTITY_CRAZY_SHOTGUN)
|
|
|
|
|| (Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW)
|
|
|
|
|| Index == ENTITY_DOOR
|
|
|
|
);
|
2016-04-29 14:53:19 +00:00
|
|
|
}
|