Error check on element destroy
This commit is contained in:
@@ -156,13 +156,14 @@ function getVehicleForNetworkEvent(vehicle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function deleteGameElement(element) {
|
function deleteGameElement(element) {
|
||||||
logToConsole(LOG_DEBUG, `Destroying game element ${element.id} (Type: ${element.type})`);
|
try {
|
||||||
if(element != null) {
|
if(element != null) {
|
||||||
//removeFromWorld(element);
|
destroyElement(element);
|
||||||
destroyElement(element);
|
return true;
|
||||||
return true;
|
}
|
||||||
|
} catch(error) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user