When an enemy dies and drops an item on a level the player has never visited,
the item is dropped at the position (0,0). This can result in many items
gathering in one spot. This looks really weird, and that spot might not even be
accessible.
This happens because the functions that drop items are passed the virtual
position of an enemy when it dies, and not its real position. Apparently, if a
level was never visited, the virtual position of the bots in it is not
initialized and is set by default to (0,0).
The bug can be avoided by adding the following to line 758 in enemy.c:
if (!Me.HaveBeenToLevel[ThisRobot->pos.z]) {
update_virtual_position(&ThisRobot->virt_pos, &ThisRobot->pos, ThisRobot->pos.z);
}
or alternatively replace virt_pos with pos in the same function. I don't know
what other effects either of those ways have.
This is not a problem in the game currently, but if we want the bots to actually
drop dead after the game is won it might become a problem when the player comes
across an affected level afterwards. We might also in the future want to have
the player either meet a character or come across his/her corpse and collect an
item, depending on their actions before entering the character's level. That
would be blocked by this issue.
|