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