pas2c happiness initiative 2017, continued
authorsheepluva
Sat, 30 Sep 2017 00:09:48 +0200
changeset 12605 ef780eda6e48
parent 12604 95f0e475ca8e
child 12606 726b1edfc511
pas2c happiness initiative 2017, continued
hedgewars/uGearsHedgehog.pas
hedgewars/uGearsUtils.pas
hedgewars/uScript.pas
--- a/hedgewars/uGearsHedgehog.pas	Fri Sep 29 23:31:29 2017 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Sat Sep 30 00:09:48 2017 +0200
@@ -693,7 +693,7 @@
             cnt:= Ammoz[ammo].NumberInCase;
 
         if (ammo = amNothing) or (cnt = 0) then
-            s:= ansistring(trmsg[sidEmptyCrate])
+            s:= trmsg[sidEmptyCrate]
         else if cnt >= AMMO_INFINITE then
             s:= name + ansistring(' (+∞)')
         else
--- a/hedgewars/uGearsUtils.pas	Fri Sep 29 23:31:29 2017 +0200
+++ b/hedgewars/uGearsUtils.pas	Sat Sep 30 00:09:48 2017 +0200
@@ -709,10 +709,10 @@
                     if isDirH then
                         begin
                         tmp:= hwRound(Gear^.X - Gear^.dX);
-                        if abs(tmp - leftX) < abs(tmp - rightX) then  // left edge
-                            isImpact:= (abs(tmp-leftX) >= Gear^.Radius) and (Gear^.dX.isNegative)
+                        if abs(tmp - real(leftX)) < abs(tmp - real(rightX)) then  // left edge
+                            isImpact:= (abs(tmp-real(leftX)) >= Gear^.Radius) and (Gear^.dX.isNegative)
                         else
-                            isImpact:= (abs(tmp-rightX) >= Gear^.Radius) and (not Gear^.dX.isNegative);
+                            isImpact:= (abs(tmp-real(rightX)) >= Gear^.Radius) and (not Gear^.dX.isNegative);
                         end
                     else
                         begin
--- a/hedgewars/uScript.pas	Fri Sep 29 23:31:29 2017 +0200
+++ b/hedgewars/uScript.pas	Sat Sep 30 00:09:48 2017 +0200
@@ -2101,27 +2101,27 @@
 
                 lua_newtable(L);
 
-                lua_pushstring(L, 'Kills');
+                lua_pushstring(L, str2pchar('Kills'));
                 lua_pushnumber(L, TeamsArray[i]^.stats.Kills);
                 lua_settable(L, -3);
 
-                lua_pushstring(L, 'Suicides');
+                lua_pushstring(L, str2pchar('Suicides'));
                 lua_pushnumber(L, TeamsArray[i]^.stats.Suicides);
                 lua_settable(L, -3);
 
-                lua_pushstring(L, 'AIKills');
+                lua_pushstring(L, str2pchar('AIKills'));
                 lua_pushnumber(L, TeamsArray[i]^.stats.AIKills);
                 lua_settable(L, -3);
 
-                lua_pushstring(L, 'TeamKills');
+                lua_pushstring(L, str2pchar('TeamKills'));
                 lua_pushnumber(L, TeamsArray[i]^.stats.TeamKills);
                 lua_settable(L, -3);
 
-                lua_pushstring(L, 'TurnSkips');
+                lua_pushstring(L, str2pchar('TurnSkips'));
                 lua_pushnumber(L, TeamsArray[i]^.stats.TurnSkips);
                 lua_settable(L, -3);
 
-                lua_pushstring(L, 'TeamDamage');
+                lua_pushstring(L, str2pchar('TeamDamage'));
                 lua_pushnumber(L, TeamsArray[i]^.stats.TeamDamage);
                 lua_settable(L, -3);