1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-26 02:07:26 +00:00

Fix typo in 5a9025a2a7 that caused crashing

This commit is contained in:
fgenesis 2023-09-24 18:04:40 +02:00
parent 60e3c4d7ad
commit 7cd8f51b47

View file

@ -1928,13 +1928,13 @@ void Entity::moveAroundAngle(int angle, float dt, int spd, int dir)
void Entity::moveTowardsTarget(float dt, int spd, size_t t) void Entity::moveTowardsTarget(float dt, int spd, size_t t)
{ {
if (targets.size() < t || !targets[t]) return; if (t >= targets.size() || !targets[t]) return;
moveTowards(targets[t]->position, dt, spd); moveTowards(targets[t]->position, dt, spd);
} }
void Entity::moveAroundTarget(float dt, int spd, int dir, size_t t) void Entity::moveAroundTarget(float dt, int spd, int dir, size_t t)
{ {
if (targets.size() < t || !targets[t]) return; if (t >= targets.size() || !targets[t]) return;
moveAround(targets[t]->position, dt, spd, dir); moveAround(targets[t]->position, dt, spd, dir);
} }