Page MenuHomeWildfire Games

Cache isDomestic [UnitAi]
AbandonedPublic

Authored by Silier on Dec 28 2019, 11:01 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Since classes in cmpIdentity are not changed through the game, it is safe to cache result of one call to it and then return value of that variable.

This is reducing calls to engine for identity component.

IsDomestic() is called on Order.Walk, Order.Stop, Order.WalkAndFight, Order.WalkToTarget.

Test Plan

Check if it cannot be done better.

Event Timeline

Silier created this revision.Dec 28 2019, 11:01 PM
Silier added a reviewer: Restricted Owners Package.

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/908/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1052|1052| 			},
|1053|1053| 		},
|1054|1054| 
|1055|    |-		"GARRISON":{
|    |1055|+		"GARRISON": {
|1056|1056| 			"APPROACHING": {
|1057|1057| 				"enter": function() {
|1058|1058| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2023|2023| 
|2024|2024| 				"Attacked": function(msg) {
|2025|2025| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2026|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2027|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2026|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2027|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2028|2028| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2029|2029| 				},
|2030|2030| 			},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2758|2758| 					{
|2759|2759| 						// The building was already finished/fully repaired before we arrived;
|2760|2760| 						// let the ConstructionFinished handler handle this.
|2761|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2761|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2762|2762| 						return true;
|2763|2763| 					}
|2764|2764| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2758|2758| 					{
|2759|2759| 						// The building was already finished/fully repaired before we arrived;
|2760|2760| 						// let the ConstructionFinished handler handle this.
|2761|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2761|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2762|2762| 						return true;
|2763|2763| 					}
|2764|2764| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3278|3278| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3279|3279| 
|3280|3280| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3281|    |-							// only used for domestic animals
|    |3281|+		// only used for domestic animals
|3282|3282| 	},
|3283|3283| };
|3284|3284| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3337|3337| 
|3338|3338| UnitAI.prototype.IsAnimal = function()
|3339|3339| {
|3340|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3340|+	return (!!this.template.NaturalBehaviour);
|3341|3341| };
|3342|3342| 
|3343|3343| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3457|3457| 		{
|3458|3458| 			let index = this.GetCurrentState().indexOf(".");
|3459|3459| 			if (index != -1)
|3460|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3460|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3461|3461| 			this.Stop(false);
|3462|3462| 		}
|3463|3463| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3513|3513| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3514|3514| 			continue;
|3515|3515| 		if (i == 0)
|3516|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3516|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3517|3517| 		else
|3518|3518| 			this.orderQueue.splice(i, 1);
|3519|3519| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3513|3513| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3514|3514| 			continue;
|3515|3515| 		if (i == 0)
|3516|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3516|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3517|3517| 		else
|3518|3518| 			this.orderQueue.splice(i, 1);
|3519|3519| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3597|3597| };
|3598|3598| 
|3599|3599| 
|3600|    |-//// FSM linkage functions ////
|    |3600|+// // FSM linkage functions ////
|3601|3601| 
|3602|3602| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3603|3603| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3767|3767| 				continue;
|3768|3768| 			if (this.orderQueue[i].type == type)
|3769|3769| 				continue;
|3770|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3770|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3771|3771| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3772|3772| 			return;
|3773|3773| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3767|3767| 				continue;
|3768|3768| 			if (this.orderQueue[i].type == type)
|3769|3769| 				continue;
|3770|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3770|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3771|3771| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3772|3772| 			return;
|3773|3773| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4009|4009| 	if (data.timerRepeat === undefined)
|4010|4010| 		this.timer = undefined;
|4011|4011| 
|4012|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4012|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4013|4013| };
|4014|4014| 
|4015|4015| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4009|4009| 	if (data.timerRepeat === undefined)
|4010|4010| 		this.timer = undefined;
|4011|4011| 
|4012|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4012|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4013|4013| };
|4014|4014| 
|4015|4015| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4054|4054| 	// TODO: This is a bit inefficient since every unit listens to every
|4055|4055| 	// construction message - ideally we could scope it to only the one we're building
|4056|4056| 
|4057|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4057|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4058|4058| };
|4059|4059| 
|4060|4060| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4054|4054| 	// TODO: This is a bit inefficient since every unit listens to every
|4055|4055| 	// construction message - ideally we could scope it to only the one we're building
|4056|4056| 
|4057|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4057|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4058|4058| };
|4059|4059| 
|4060|4060| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4079|4079| 
|4080|4080| UnitAI.prototype.OnAttacked = function(msg)
|4081|4081| {
|4082|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4082|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4083|4083| };
|4084|4084| 
|4085|4085| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4079|4079| 
|4080|4080| UnitAI.prototype.OnAttacked = function(msg)
|4081|4081| {
|4082|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4082|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4083|4083| };
|4084|4084| 
|4085|4085| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4084|4084| 
|4085|4085| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4086|4086| {
|4087|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4087|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4088|4088| };
|4089|4089| 
|4090|4090| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4084|4084| 
|4085|4085| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4086|4086| {
|4087|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4087|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4088|4088| };
|4089|4089| 
|4090|4090| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4089|4089| 
|4090|4090| UnitAI.prototype.OnHealthChanged = function(msg)
|4091|4091| {
|4092|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4092|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4093|4093| };
|4094|4094| 
|4095|4095| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4089|4089| 
|4090|4090| UnitAI.prototype.OnHealthChanged = function(msg)
|4091|4091| {
|4092|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4092|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4093|4093| };
|4094|4094| 
|4095|4095| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4095|4095| UnitAI.prototype.OnRangeUpdate = function(msg)
|4096|4096| {
|4097|4097| 	if (msg.tag == this.losRangeQuery)
|4098|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4098|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4099|4099| 	else if (msg.tag == this.losHealRangeQuery)
|4100|4100| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4101|4101| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4095|4095| UnitAI.prototype.OnRangeUpdate = function(msg)
|4096|4096| {
|4097|4097| 	if (msg.tag == this.losRangeQuery)
|4098|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4098|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4099|4099| 	else if (msg.tag == this.losHealRangeQuery)
|4100|4100| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4101|4101| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4097|4097| 	if (msg.tag == this.losRangeQuery)
|4098|4098| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4099|4099| 	else if (msg.tag == this.losHealRangeQuery)
|4100|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4100|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4101|4101| };
|4102|4102| 
|4103|4103| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4097|4097| 	if (msg.tag == this.losRangeQuery)
|4098|4098| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4099|4099| 	else if (msg.tag == this.losHealRangeQuery)
|4100|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4100|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4101|4101| };
|4102|4102| 
|4103|4103| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4102|4102| 
|4103|4103| UnitAI.prototype.OnPackFinished = function(msg)
|4104|4104| {
|4105|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4105|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4106|4106| };
|4107|4107| 
|4108|4108| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4102|4102| 
|4103|4103| UnitAI.prototype.OnPackFinished = function(msg)
|4104|4104| {
|4105|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4105|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4106|4106| };
|4107|4107| 
|4108|4108| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4105|4105| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4106|4106| };
|4107|4107| 
|4108|    |-//// Helper functions to be called by the FSM ////
|    |4108|+// // Helper functions to be called by the FSM ////
|4109|4109| 
|4110|4110| UnitAI.prototype.GetWalkSpeed = function()
|4111|4111| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4773|4773| UnitAI.prototype.AttackEntityInZone = function(ents)
|4774|4774| {
|4775|4775| 	var target = ents.find(target =>
|4776|    |-		this.CanAttack(target)
|4777|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4776|+		this.CanAttack(target) &&
|    |4777|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4778|4778| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4779|4779| 	);
|4780|4780| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4774|4774| {
|4775|4775| 	var target = ents.find(target =>
|4776|4776| 		this.CanAttack(target)
|4777|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4778|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4777|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4778|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4779|4779| 	);
|4780|4780| 	if (!target)
|4781|4781| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4838|4838| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4839|4839| 	if (this.isGuardOf)
|4840|4840| 	{
|4841|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4841|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4842|4842| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4843|4843| 		if (cmpUnitAI && cmpAttack &&
|4844|4844| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4842|4842| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4843|4843| 		if (cmpUnitAI && cmpAttack &&
|4844|4844| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4845|    |-				return false;
|    |4845|+			return false;
|4846|4846| 	}
|4847|4847| 
|4848|4848| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4880|4880| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4881|4881| 	if (this.isGuardOf)
|4882|4882| 	{
|4883|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4883|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4884|4884| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4885|4885| 		if (cmpUnitAI && cmpAttack &&
|4886|4886| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4893|4893| 	return false;
|4894|4894| };
|4895|4895| 
|4896|    |-//// External interface functions ////
|    |4896|+// // External interface functions ////
|4897|4897| 
|4898|4898| UnitAI.prototype.SetFormationController = function(ent)
|4899|4899| {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5049|5049| 	{
|5050|5050| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5051|5051| 			return;
|5052|    |-		else
|5053|    |-			this.RemoveGuard();
|    |5052|+		this.RemoveGuard();
|5054|5053| 	}
|5055|5054| 
|5056|5055| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5391|5391| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5392|5392| 	{
|5393|5393| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5394|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5394|+		if (cmpTrader.HasBothMarkets() &&
|5395|5395| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5396|5396| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5397|5397| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5672|5672| 				{
|5673|5673| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5674|5674| 					var targetClasses = this.order.data.targetClasses;
|5675|    |-					if (targetClasses.attack && cmpIdentity
|5676|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5675|+					if (targetClasses.attack && cmpIdentity &&
|    |5676|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5677|5677| 						continue;
|5678|5678| 					if (targetClasses.avoid && cmpIdentity
|5679|5679| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5675|5675| 					if (targetClasses.attack && cmpIdentity
|5676|5676| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5677|5677| 						continue;
|5678|    |-					if (targetClasses.avoid && cmpIdentity
|5679|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5678|+					if (targetClasses.avoid && cmpIdentity &&
|    |5679|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5680|5680| 						continue;
|5681|5681| 					// Only used by the AIs to prevent some choices of targets
|5682|5682| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5698|5698| 		{
|5699|5699| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5700|5700| 			var targetClasses = this.order.data.targetClasses;
|5701|    |-			if (cmpIdentity && targetClasses.attack
|5702|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5701|+			if (cmpIdentity && targetClasses.attack &&
|    |5702|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5703|5703| 				continue;
|5704|5704| 			if (cmpIdentity && targetClasses.avoid
|5705|5705| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5701|5701| 			if (cmpIdentity && targetClasses.attack
|5702|5702| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5703|5703| 				continue;
|5704|    |-			if (cmpIdentity && targetClasses.avoid
|5705|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5704|+			if (cmpIdentity && targetClasses.avoid &&
|    |5705|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5706|5706| 				continue;
|5707|5707| 			// Only used by the AIs to prevent some choices of targets
|5708|5708| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5858|5858| 
|5859|5859| UnitAI.prototype.SetHeldPosition = function(x, z)
|5860|5860| {
|5861|    |-	this.heldPosition = {"x": x, "z": z};
|    |5861|+	this.heldPosition = { "x": x, "z": z};
|5862|5862| };
|5863|5863| 
|5864|5864| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5858|5858| 
|5859|5859| UnitAI.prototype.SetHeldPosition = function(x, z)
|5860|5860| {
|5861|    |-	this.heldPosition = {"x": x, "z": z};
|    |5861|+	this.heldPosition = {"x": x, "z": z };
|5862|5862| };
|5863|5863| 
|5864|5864| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5885|5885| 	return false;
|5886|5886| };
|5887|5887| 
|5888|    |-//// Helper functions ////
|    |5888|+// // Helper functions ////
|5889|5889| 
|5890|5890| UnitAI.prototype.CanAttack = function(target)
|5891|5891| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6089|6089| 	return cmpPack && cmpPack.IsPacking();
|6090|6090| };
|6091|6091| 
|6092|    |-//// Formation specific functions ////
|    |6092|+// // Formation specific functions ////
|6093|6093| 
|6094|6094| UnitAI.prototype.IsAttackingAsFormation = function()
|6095|6095| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6094|6094| UnitAI.prototype.IsAttackingAsFormation = function()
|6095|6095| {
|6096|6096| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6097|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6098|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6097|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6098|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6099|6099| };
|6100|6100| 
|6101|6101| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6098|6098| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6099|6099| };
|6100|6100| 
|6101|    |-//// Animal specific functions ////
|    |6101|+// // Animal specific functions ////
|6102|6102| 
|6103|6103| UnitAI.prototype.MoveRandomly = function(distance)
|6104|6104| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 338| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1240| »   »   »   »   return·false;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Timer' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|3914| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4760| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4775| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4821| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4844| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2027| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|3861| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3945| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4777| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4778| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5676| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5679| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5692| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5693| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5699| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity);
|    | [NORMAL] JSHintBear:
|    | 'cmpIdentity' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5700| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5702| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5705| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5780| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5783| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5788| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5791| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5792| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5802| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5805| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|6098| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1424/display/redirect

elexis added a subscriber: elexis.Dec 28 2019, 11:22 PM

classes in cmpIdentity are not changed through the game

wraitii had a patch changing that (which I'm not sure if it was a good idea since it is one of the basic assumptions that the template of a unit won't change unless going through transformation and receiving a new entity ID)

This is reducing calls to engine for identity component.

Notice that this in turn also increases memory load - for every unit.
It will also serialize this property increasing savegame state (that thing is also transmitted via network).

That would be (4v4 * 300 pop + 200 gaia animals + 1600 gaia units * 4(?) bytes = 16kb, so I guess it's not much, but it's also not nothing, especially if this approach would be done for N other components and M other template classes per component.
So mostly saying that memory/performance tradeoffs shouldn't be taken for granted to be always advantageous but should be checked.

If the approach of the patch is followed, then I supposed you can both improve the performance of the patch and reduce the lines of code of the patch by caching the classes when constructing the unit, not when calling the function for the first time.
And perhaps then one can just do something like this.classes = cmpIdentity.getClasses... (which would then reduce the cost of a lookup to an indexOf call) or this.myClass = cmpIdentity.HasClass(....

Then at last the completeness test - why is it done for this class but not the other classes. If this optimization can be performed in 50 places it could be changed in 50 patches, or less.

No objections from my side as long as nothing goes kaput.

(Also the cmpFoo references can be cached as the entity components don'T change except upon Deserialization.)

Stan added a subscriber: Stan.Dec 29 2019, 12:05 AM

(Also the cmpFoo references can be cached as the entity components don'T change except upon Deserialization.)

Really wraitii told me the pointers get invalidated all the time...

Using this https://code.wildfiregames.com/P190 in a file called aaa_Engine.js and replacing all the calls of Engine.QueryInterface() to Engine2.QueryInterface, I get the game to crash when timeout is too big.

Silier abandoned this revision.Jul 17 2020, 12:42 PM