Fix bad CheckEntity code

This commit is contained in:
Jackzie 2024-07-18 19:07:27 -05:00
parent 1afa946472
commit 6f692cfa08

View file

@ -156,12 +156,11 @@ enum struct EditorData {
}
bool CheckEntity() {
if(this.entity != INVALID_ENT_REFERENCE) {
if(this.entity == -1 && !IsValidEntity(this.entity)) {
PrintToChat(this.client, "\x04[Editor]\x01 Entity has vanished, editing cancelled.");
this.Reset();
return false;
}
if(this.flags & Edit_WallCreator) return true;
if(this.entity == INVALID_ENT_REFERENCE || this.entity == -1 || !IsValidEntity(this.entity)) {
PrintToChat(this.client, "\x04[Editor]\x01 Entity has vanished, editing cancelled.");
this.Reset();
return false;
}
return true;
}