Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Player.js
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/** | /** | ||||
* Similar to Engine.QueryInterface but first checks if the entity | * Similar to Engine.QueryInterface but first checks if the entity | ||||
* mirages the interface. | * mirages the interface. | ||||
*/ | */ | ||||
function QueryMiragedInterface(ent, iid) | function QueryMiragedInterface(ent, iid) | ||||
{ | { | ||||
let cmpMirage = Engine.QueryInterface(ent, IID_Mirage); | const cmpMirage = Engine.QueryInterface(ent, IID_Mirage); | ||||
if (cmpMirage && !cmpMirage.Mirages(iid)) | if (cmpMirage && !cmpMirage.Mirages(iid)) | ||||
{ | |||||
warn("Attempted to query miraged interface " + iid + ", which does not exist"); | |||||
// Print out the stack because the above is a little useless (numeric value). | |||||
warn(new Error().stack); | |||||
return null; | return null; | ||||
} | |||||
else if (!cmpMirage) | else if (!cmpMirage) | ||||
return Engine.QueryInterface(ent, iid); | return Engine.QueryInterface(ent, iid); | ||||
return cmpMirage.Get(iid); | return cmpMirage.Get(iid); | ||||
} | } | ||||
/** | /** | ||||
* Similar to Engine.QueryInterface, but checks for all interfaces | * Similar to Engine.QueryInterface, but checks for all interfaces | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator