Fixed bug: Polymorph over water.

This commit is contained in:
johns 2001-04-27 14:01:47 +00:00
parent 13961a1f40
commit fe17bd22aa
2 changed files with 7 additions and 2 deletions
doc
src/stratagus

View file

@ -624,6 +624,7 @@
<LI>Added support for mouse clicks on icons of selections.
<LI>Automatic groups added.
<LI>Fixed bug: Units in training queues aren't upgraded. (Paladin,Ranger...)
<LI>Fixed bug: Polymorph over water, places a critter on water :).
<LI>+++
</UL>
</UL>

View file

@ -713,13 +713,17 @@ global int SpellCast(const SpellType * spell, Unit * unit, Unit * target,
case SpellActionPolymorph:
if (target && target->Type->Organic) {
Player *pl = target->Player;
UnitType* type;
unit->Player->Score+=target->Type->Points;
// as said somewhere else -- no corpses :)
RemoveUnit(target);
UnitLost(target);
ReleaseUnit(target);
MakeUnitAndPlace(x, y, UnitTypeByIdent("unit-critter"), pl);
type=UnitTypeByIdent("unit-critter");
if( CanMoveToMask(x,y,TypeMovementMask(type)) ) {
MakeUnitAndPlace(x, y, type, Players+PlayerNumNeutral);
}
unit->Mana -= spell->ManaCost;