mirror of https://gitlab.com/drummyfish/anarch.git
Fix monster collisions
This commit is contained in:
parent
5dd6a01c87
commit
354bf534b9
7
main.c
7
main.c
|
@ -1228,6 +1228,7 @@ void SFG_getItemSprite(
|
||||||
case SFG_LEVEL_ELEMENT_TREE:
|
case SFG_LEVEL_ELEMENT_TREE:
|
||||||
case SFG_LEVEL_ELEMENT_RUIN:
|
case SFG_LEVEL_ELEMENT_RUIN:
|
||||||
case SFG_LEVEL_ELEMENT_LAMP:
|
case SFG_LEVEL_ELEMENT_LAMP:
|
||||||
|
case SFG_LEVEL_ELEMENT_TELEPORT:
|
||||||
*spriteSize = 2;
|
*spriteSize = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1235,7 +1236,6 @@ void SFG_getItemSprite(
|
||||||
*spriteSize = 1;
|
*spriteSize = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SFG_LEVEL_ELEMENT_TELEPORT:
|
|
||||||
case SFG_LEVEL_ELEMENT_FINISH:
|
case SFG_LEVEL_ELEMENT_FINISH:
|
||||||
case SFG_LEVEL_ELEMENT_COLUMN:
|
case SFG_LEVEL_ELEMENT_COLUMN:
|
||||||
*spriteSize = 3;
|
*spriteSize = 3;
|
||||||
|
@ -2143,6 +2143,11 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster)
|
||||||
|
|
||||||
collision =
|
collision =
|
||||||
RCL_abs(currentHeight - newHeight) > RCL_CAMERA_COLL_STEP_HEIGHT;
|
RCL_abs(currentHeight - newHeight) > RCL_CAMERA_COLL_STEP_HEIGHT;
|
||||||
|
|
||||||
|
if (!collision)
|
||||||
|
collision =
|
||||||
|
(SFG_ceilingHeightAt(newPos[0] / 4,newPos[1] / 4) - newHeight) <
|
||||||
|
SFG_MONSTER_COLLISION_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (collision)
|
if (collision)
|
||||||
|
|
Loading…
Reference in New Issue