Use new native util functions

This commit is contained in:
Vortrex
2020-12-12 06:11:16 -06:00
parent df178de9e6
commit d4efdcd096
9 changed files with 83 additions and 52 deletions

View File

@@ -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);
}
// ---------------------------------------------------------------------------