public void LoadUpgradeLevel(LogicJSONObject jsonObject) { LogicJSONNumber lvlObject = jsonObject.GetJSONNumber("lvl"); LogicTrapData data = this.GetTrapData(); if (lvlObject != null) { this.m_upgLevel = lvlObject.GetIntValue(); int maxLvl = data.GetUpgradeLevelCount(); if (this.m_upgLevel >= maxLvl) { Debugger.Warning(string.Format("LogicTrap::load() - Loaded upgrade level {0} is over max! (max = {1}) id {2} data id {3}", lvlObject.GetIntValue(), maxLvl, this.m_globalId, data.GetGlobalID())); this.m_upgLevel = maxLvl - 1; } else { if (this.m_upgLevel < -1) { Debugger.Error("LogicTrap::load() - Loaded an illegal upgrade level!"); } } } }