From 3021f19799ba4b0834ec2e59852fe3401a470bfa Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 14 May 2025 12:09:05 -0500 Subject: [PATCH] Fix PCs allowed to step sideways onto giants' legs --- src/universe/creature.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/universe/creature.cpp b/src/universe/creature.cpp index d76ad559..948e009d 100644 --- a/src/universe/creature.cpp +++ b/src/universe/creature.cpp @@ -323,9 +323,11 @@ int cCreature::get_level() const { } bool cCreature::on_space(location loc) const { - if(loc.x - cur_loc.x >= 0 && loc.x - cur_loc.x <= x_width - 1 && - loc.y - cur_loc.y >= 0 && loc.y - cur_loc.y <= y_width - 1) - return true; + for(int x = cur_loc.x; x < cur_loc.x + x_width; ++x){ + for(int y = cur_loc.y; y < cur_loc.y + y_width; ++y){ + if(loc.x == x && loc.y == y) return true; + } + } return false; }