- some remaining sprite[] access in ai.cpp

# Conflicts:
#	source/games/blood/src/ai.cpp
This commit is contained in:
Christoph Oelckers 2021-05-05 16:06:35 +02:00
parent f712a674ce
commit 9b4ee3dc2c

View file

@ -166,16 +166,16 @@ bool CanMove(DBloodActor *actor, DBloodActor* target, int nAngle, int nRange)
if (sector[nSector].type == kSectorDamage || pXSector->damageType > 0) if (sector[nSector].type == kSectorDamage || pXSector->damageType > 0)
Crusher = 1; Crusher = 1;
} }
int nUpper = gUpperLink[nSector]; auto Upper = getUpperLink(nSector);
int nLower = gLowerLink[nSector]; auto Lower = getLowerLink(nSector);
if (nUpper >= 0) if (Upper != nullptr)
{ {
if (sprite[nUpper].type == kMarkerUpWater || sprite[nUpper].type == kMarkerUpGoo) if (Upper->s().type == kMarkerUpWater || Upper->s().type == kMarkerUpGoo)
Water = Depth = 1; Water = Depth = 1;
} }
if (nLower >= 0) if (Lower != nullptr)
{ {
if (sprite[nLower].type == kMarkerLowWater || sprite[nLower].type == kMarkerLowGoo) if (Lower->s().type == kMarkerLowWater || Lower->s().type == kMarkerLowGoo)
Depth = 1; Depth = 1;
} }
switch (pSprite->type) { switch (pSprite->type) {