aboutsummaryrefslogtreecommitdiff
path: root/featureClass
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-28 15:18:15 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-28 15:18:15 +0800
commitdc4a2cb096b3fd7ddb7d133853f6a5436026b2ca (patch)
treef8d82c111bd73ec11b7d9d8539064528ba50458c /featureClass
parent2b71eace5e20e0340578871eda491f314a34e285 (diff)
downloadSoopyV2-dc4a2cb096b3fd7ddb7d133853f6a5436026b2ca.tar.gz
SoopyV2-dc4a2cb096b3fd7ddb7d133853f6a5436026b2ca.tar.bz2
SoopyV2-dc4a2cb096b3fd7ddb7d133853f6a5436026b2ca.zip
fix bug
Diffstat (limited to 'featureClass')
-rw-r--r--featureClass/class.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/featureClass/class.js b/featureClass/class.js
index 581f6ba..d1ddbc6 100644
--- a/featureClass/class.js
+++ b/featureClass/class.js
@@ -76,17 +76,18 @@ class Feature {
let theEvent
try{
theEvent = this.FeatureManager.registerForge(event, func, this)
-
- this.forgeEvents[theEvent.id] = theEvent
}catch(e){
if(!messageIfError) messageIfError = "An error occured while registering the event " + event.class.toString().split(".").pop() + ", this may cause " + this.constructor.name + " to not work properly."
ChatLib.chat(this.FeatureManager.messagePrefix + messageIfError)
}
+ if(theEvent)this.forgeEvents[theEvent.id] = theEvent
return theEvent
}
unregisterForge(event){
+ if(!event) return
+
this.FeatureManager.unregisterForge(event)
delete this.forgeEvents[event.id]