Move the TraitInfo stuff into rules.lua

This commit is contained in:
ScottNZ
2013-12-20 22:53:37 +13:00
parent 883b014888
commit 7ca5d56c1f
8 changed files with 31 additions and 26 deletions

21
mods/common/lua/rules.lua Normal file
View File

@@ -0,0 +1,21 @@
Rules = { }
Rules.HasTraitInfo = function(actorType, className)
return Internal.HasTraitInfo(actorType, className)
end
Rules.TraitInfoOrDefault = function(actorType, className)
return Internal.TraitInfoOrDefault(actorType, className)
end
Rules.TraitInfo = function(actorType, className)
return Internal.TraitInfo(actorType, className)
end
Rules.InitialAltitude = function(actorType)
local ai = Rules.TraitInfoOrDefault(actorType, "AircraftInfo")
if ai ~= nil then
return ai.CruiseAltitude
end
return 0
end