Convert entity types to an enum (#1007)

In an effort to remove magic numbers, I've given every entity type a
name. Hopefully I didn't miss anywhere.

Also, add `createentity` case 100 for backwards compatibility.

Co-authored-by: NyakoFox <nyakowofox@gmail.com>
Co-authored-by: Dav999 <dav999.tolp@gmail.com>
This commit is contained in:
Ally
2024-11-17 12:45:57 -04:00
committed by GitHub
parent 9c45dfb845
commit 63880169e6
7 changed files with 181 additions and 120 deletions

View File

@@ -11,7 +11,7 @@ entclass::entclass(void)
void entclass::clear(void)
{
invis = false;
type = 0;
type = EntityType_PLAYER;
size = 0;
tile = 0;
rule = 0;
@@ -650,8 +650,8 @@ void entclass::updatecolour(void)
bool entclass::ishumanoid(void)
{
return type == 0
|| type == 12
|| type == 14
|| type == 55;
return type == EntityType_PLAYER
|| type == EntityType_CREWMATE
|| type == EntityType_SUPERCREWMATE
|| type == EntityType_COLLECTABLE_CREWMATE;
}