# HG changeset patch # User nemo # Date 1350260648 14400 # Node ID b8958e64e68d7533eaebbf680af39bd08a680978 # Parent e81dc9bef8b82dcf0fabd204043e5615b954a464 Also shove using shotgun, switch off hat when not active hog diff -r e81dc9bef8b8 -r b8958e64e68d hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Oct 14 13:35:15 2012 -0400 +++ b/hedgewars/uGears.pas Sun Oct 14 20:24:08 2012 -0400 @@ -671,6 +671,7 @@ gtHedgehog, gtMine, gtSMine, + gtKnife, gtCase, gtTarget, gtExplosives, @@ -698,6 +699,7 @@ t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX); t^.dY:= t^.dY + Gear^.dY * dmg * _0_01; t^.State:= t^.State or gstMoving; + if t^.Kind = gtKnife then t^.State:= t^.State and not gstCollision; t^.Active:= true; FollowGear:= t end diff -r e81dc9bef8b8 -r b8958e64e68d hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Sun Oct 14 13:35:15 2012 -0400 +++ b/hedgewars/uTeams.pas Sun Oct 14 20:24:08 2012 -0400 @@ -20,7 +20,7 @@ unit uTeams; interface -uses uConsts, uInputHandler, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound, +uses uConsts, uInputHandler, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound, uStore, uTypes{$IFDEF USE_TOUCH_INTERFACE}, uWorld{$ENDIF}; procedure initModule; @@ -628,12 +628,16 @@ var oldCI, newCI: boolean; oldHH: PHedgehog; begin + if (CurrentHedgehog <> nil) and (CurrentHedgehog^.CurAmmoType = amKnife) then + LoadHedgehogHat(CurrentHedgehog^, CurrentHedgehog^.Hat); oldCI:= (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.CollisionIndex >= 0); newCI:= (newHog^.Gear <> nil) and (newHog^.Gear^.CollisionIndex >= 0); if oldCI then DeleteCI(CurrentHedgehog^.Gear); if newCI then DeleteCI(newHog^.Gear); oldHH:= CurrentHedgehog; CurrentHedgehog:= newHog; + if (CurrentHedgehog <> nil) and (CurrentHedgehog^.CurAmmoType = amKnife) then + LoadHedgehogHat(CurrentHedgehog^, 'Reserved/chef'); if oldCI then AddGearCI(oldHH^.Gear); if newCI then AddGearCI(newHog^.Gear) end;