# HG changeset patch # User nemo # Date 1341420107 14400 # Node ID 5984b749ad9b29b014ccc7ea16076e57c313e140 # Parent c224cd2d32f3b7b0f090cabe775f4865315b6a5d free up power for use by script diff -r c224cd2d32f3 -r 5984b749ad9b hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Wed Jul 04 10:56:42 2012 -0400 +++ b/hedgewars/GSHandlers.inc Wed Jul 04 12:41:47 2012 -0400 @@ -2120,15 +2120,14 @@ voices. Reinforcements voices is heard for active team, not team-to-be. Either that or change crate spawn from end of turn to start, although that has its own complexities. *) // Abuse a couple of gear values to track origin - Gear^.Angle:= hwRound(Gear^.X); - Gear^.Power:= hwRound(Gear^.Y); + Gear^.Angle:= hwRound(Gear^.Y); Gear^.Tag:= random(2); inc(Gear^.Timer) end; if Gear^.Timer < 1833 then inc(Gear^.Timer); if Gear^.Timer = 1000 then begin - sparkles:= AddVisualGear(Gear^.Angle, Gear^.Power, vgtDust, 1); + sparkles:= AddVisualGear(hwRound(Gear^.X), Gear^.Angle, vgtDust, 1); if sparkles <> nil then begin sparkles^.dX:= 0; diff -r c224cd2d32f3 -r 5984b749ad9b hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Wed Jul 04 10:56:42 2012 -0400 +++ b/hedgewars/uGearsHedgehog.pas Wed Jul 04 12:41:47 2012 -0400 @@ -605,7 +605,10 @@ or (HH^.Hedgehog^.Team^.Clan^.ClanIndex = LocalClan) or (GameType = gmtDemo) then begin - s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Ammoz[a].NumberInCase) + ')'; + if Gear^.Power <> 0 then + s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Gear^.Power) + ')' + else + s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Ammoz[a].NumberInCase) + ')'; AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo); // show ammo icon diff -r c224cd2d32f3 -r 5984b749ad9b hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Wed Jul 04 10:56:42 2012 -0400 +++ b/hedgewars/uGearsRender.pas Wed Jul 04 12:41:47 2012 -0400 @@ -1018,7 +1018,7 @@ if Gear^.Timer < 1833 then begin DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0, - Gear^.Angle+WorldDx, Gear^.Power+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270); + x, Gear^.Angle+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270); end end; gtExplosives: begin diff -r c224cd2d32f3 -r 5984b749ad9b hedgewars/uScript.pas --- a/hedgewars/uScript.pas Wed Jul 04 10:56:42 2012 -0400 +++ b/hedgewars/uScript.pas Wed Jul 04 12:41:47 2012 -0400 @@ -341,7 +341,7 @@ end else begin - if (lua_gettop(L) <> 3) then + if (lua_gettop(L) = 3) then gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), 0) else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), lua_tointeger(L, 4)); if gear <> nil then @@ -362,7 +362,7 @@ end else begin - if (lua_gettop(L) <> 3) then + if (lua_gettop(L) = 3) then gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), 0) else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), lua_tointeger(L, 4)); if gear <> nil then