# HG changeset patch
# User Wuzzy <almikes@aol.com>
# Date 1479589223 -3600
# Node ID 87edf67f21070a7d393be7614ea54356bb63e241
# Parent  a50cf6f5e3cdd4ee21ddd4a014d444e0a3296eb7
GetAmmoName now returns ammo name overwritten by SetAmmoTexts

diff -r a50cf6f5e3cd -r 87edf67f2107 hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Sat Nov 19 21:39:52 2016 +0100
+++ b/hedgewars/uScript.pas	Sat Nov 19 22:00:23 2016 +0100
@@ -2612,7 +2612,10 @@
         begin
         at:= LuaToAmmoTypeOrd(L, 1, call, params);                                                                                                   
         if at >= 0 then   
-            lua_pushstring(L, PChar(trammo[Ammoz[TAmmoType(at)].NameId]));
+            if length(trluaammo[Ammoz[TAmmoType(at)].NameId]) > 0 then
+                lua_pushstring(L, PChar(trluaammo[Ammoz[TAmmoType(at)].NameId]))
+            else
+                lua_pushstring(L, PChar(trammo[Ammoz[TAmmoType(at)].NameId]));
         end
     else
         lua_pushnil(L);