Use new native util functions
This commit is contained in:
@@ -60,4 +60,32 @@ function isNull(val) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function getEntityData(entity, dataName) {
|
||||
return entity.getData(dataName);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function setEntityData(entity, dataName, dataValue, syncToClients = true) {
|
||||
if(!isNull(server)) {
|
||||
return entity.setData(dataName, dataValue, syncToClients);
|
||||
} else {
|
||||
return entity.setData(dataName, dataValue);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function removeEntityData(entity, dataName) {
|
||||
return entity.removeData(dataName);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function doesEntityDataExist(entity, dataName) {
|
||||
return (entity.getData(dataName) != null);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user