Previously an improper check was being done to see if the player was
located on the 3 teleporting pads in the level. Even if fixng this the
spell would not work correctly if the layer was standing on the pads
when casting the spell.
Simply use TARGET_BOTH to indicate that it should not be random and send
the player to the given destination
Phasing could end up attempting to teleport to hunreds of random
location and still fail to find a valid target and send the player in to
a wall or outside the map.
This is fixed by first finding all valid locations within range and then
picking one of them at random.
Valid targets is a 13x13 area around the player minus the inner 7x7
In total there can be no more then 120 valid tiles and on average there
should be 75 avalible.
This seams to have been done to better align the magic missile fired by
the bonedeamon, but for all other monsters the alignment is less ideal
and they become unable to hit there enemy at close range.
- Lightnings cast by familiars have a short range, this was communicated
by setting midir to -1. Solved by looking at the type of the owner
- Lightning and Inferno sync position with the parent missile. Solved by
copying the sync from the guardian spell
* items: add BUGFIX, reset item get records when resetting items
The item get record array tracks items being recently looted in an
effort to prevent the same item from being looted more than once.
Prior to this commit, the item get record array (and corresponding
item get record array length) variables were not cleared when
creating a new game. Therefore, the item get record array of a
previous game could remain in between games and prevent an item
from being looted (if it was looted in a previous), even if it was
never looted in the current game. In practice this almost never
shows up, since each item get record is valid for a total of 6
seconds before being cleared. So, you would either have to save
a game, quickly loot an item, when load the game and try to loot
the same item before 6 seconds pass. OR, you could use the demo
replay functionality to run test cases, and speed up execution to
run e.g. 10'000'000 logic ticks per second. Both would exhibit the
bug and prevent the item from being looted.
This commit fixes such issues by explicitly clearing the item get
record array and item get record array length variables whenever
items are initialized.