1
0
forked from 0ad/0ad

Fix some JS warnings. Refs #2372.

This was SVN commit r14933.
This commit is contained in:
leper 2014-04-15 01:12:48 +00:00
parent e1488fee56
commit 47a516df34
3 changed files with 7 additions and 2 deletions

View File

@ -1072,6 +1072,9 @@ function handleInputBeforeGui(ev, hoveredObject)
function handleInputAfterGui(ev)
{
if (ev.hotkey === undefined)
ev.hotkey = null;
// Handle the time-warp testing features, restricted to single-player
if (!g_IsNetworked && Engine.GetGUIObjectByName("devTimeWarp").checked)
{

View File

@ -537,7 +537,7 @@ ProductionQueue.prototype.SpawnUnits = function(templateName, count, metadata)
if (cmpRallyPoint)
{
var data = cmpRallyPoint.GetData()[0];
if (data && data.target == this.entity && data.command == "garrison")
if (data && data.target && data.target == this.entity && data.command == "garrison")
cmpAutoGarrison = Engine.QueryInterface(this.entity, IID_GarrisonHolder);
}

View File

@ -3083,6 +3083,8 @@ UnitAI.prototype.Init = function()
this.lastFormationTemplate = "";
this.finishedOrder = false; // used to find if all formation members finished the order
this.heldPosition = undefined;
// Queue of remembered works
this.workOrders = [];
@ -5389,7 +5391,7 @@ UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
this.SetHeldPosition(pos.x, pos.z);
};
UnitAI.prototype.GetHeldPosition = function(pos)
UnitAI.prototype.GetHeldPosition = function()
{
return this.heldPosition;
};