Fix PCs allowed to step sideways onto giants' legs

This commit is contained in:
2025-05-14 12:09:05 -05:00
parent 6e2b6f86b7
commit 3021f19799

View File

@@ -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;
}