share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
changeset 12978 8d1bc1de9542
parent 12812 59cb9bd8331c
child 12979 b6d67e975b51
equal deleted inserted replaced
12977:ac93cd8435b4 12978:8d1bc1de9542
   736   SetHealth(hog, variants[hogVar]["hp"])
   736   SetHealth(hog, variants[hogVar]["hp"])
   737 end
   737 end
   738 
   738 
   739 function getHogInfo(hog, info)
   739 function getHogInfo(hog, info)
   740   if hog == nil then
   740   if hog == nil then
   741     AddCaption(loc("ERROR [getHogInfo]: Hog is nil!"), 0xFFFFFFFF, capgrpMessage)
   741     WriteLnToChat("ERROR [getHogInfo]: Hog is nil!")
   742     WriteLnToConsole(loc("ERROR [getHogInfo]: Hog is nil!"), 0xFFFFFFFF, capgrpMessage)
   742     WriteLnToConsole("ERROR [getHogInfo]: Hog is nil!")
   743     return
   743     return
   744   end
   744   end
   745 
   745 
   746   if hogInfo[hog] == nil then
   746   if hogInfo[hog] == nil then
   747     return nil
   747     return nil
   750   return hogInfo[hog][info]
   750   return hogInfo[hog][info]
   751 end
   751 end
   752 
   752 
   753 function setHogInfo(hog)
   753 function setHogInfo(hog)
   754   if hog == nil then
   754   if hog == nil then
   755     AddCaption(loc("ERROR [getHogInfo]: Hog is nil!"), 0xFFFFFFFF, capgrpMessage)
   755     WriteLnToChat("ERROR [getHogInfo]: Hog is nil!")
   756     WriteLnToConsole(loc("ERROR [getHogInfo]: Hog is nil!"), 0xFFFFFFFF, capgrpMessage)
   756     WriteLnToConsole("ERROR [getHogInfo]: Hog is nil!")
   757     return
   757     return
   758   end
   758   end
   759 
   759 
   760   hogInfo[hog] = {}
   760   hogInfo[hog] = {}
   761   hogInfo[hog]['maxHp'] = GetHealth(hog)
   761   hogInfo[hog]['maxHp'] = GetHealth(hog)