Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sl5net committed Feb 21, 2025
1 parent 2eca039 commit 712d1ad
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions simulation/components/Visibility~autociv.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
if (!Visibility.prototype.OnDestroy)
Visibility.prototype.OnDestroy = function () { };
Visibility.prototype.OnDestroy = function () { };

let cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
autociv_patchApplyN(Visibility.prototype, "OnDestroy", function (target, that, args)
{
if (cmpGUIInterface && cmpGUIInterface.autociv && cmpGUIInterface.autociv.corpse && cmpGUIInterface.autociv.corpse.entities) {
console.log("Removing entity " + that.entity + " from corpse list.");
cmpGUIInterface.autociv.corpse.entities.delete(that.entity);
} else {
console.log("Warning: Unable to remove entity " + that.entity + " from corpse list.");
}
return target.apply(that, args);
autociv_patchApplyN(Visibility.prototype, "OnDestroy", function (target, that, args) {
if (cmpGUIInterface && cmpGUIInterface.autociv && cmpGUIInterface.autociv.corpse && cmpGUIInterface.autociv.corpse.entities) {
console.log("Removing entity " + that.entity + " from corpse list.");
cmpGUIInterface.autociv.corpse.entities.delete(that.entity);
} else {
print("Warning: Unable to remove entity " + that.entity + " from corpse list.");
}
return target.apply(that, args);
})

Engine.ReRegisterComponentType(IID_Visibility, "Visibility", Visibility);

0 comments on commit 712d1ad

Please sign in to comment.