Add proto_is_subtype

This commit is contained in:
Alexander Batalov 2023-07-22 14:46:51 +03:00
parent d27eafe03a
commit ccabbd7688
2 changed files with 18 additions and 0 deletions

View File

@ -828,6 +828,23 @@ int _proto_dude_init(const char* path)
return 0;
}
// 0x49FEDC
bool proto_is_subtype(Proto* proto, int subtype)
{
if (subtype == -1) {
return true;
}
switch (PID_TYPE(proto->pid)) {
case OBJ_TYPE_ITEM:
return proto->item.type == subtype;
case OBJ_TYPE_SCENERY:
return proto->scenery.type == subtype;
}
return false;
}
// proto_data_member
// 0x49FFD8
int protoGetDataMember(int pid, int member, ProtoDataMemberValue* value)

View File

@ -118,6 +118,7 @@ int objectDataWrite(Object* obj, File* stream);
int _proto_update_init(Object* obj);
int _proto_dude_update_gender();
int _proto_dude_init(const char* path);
bool proto_is_subtype(Proto* proto, int subtype);
int protoGetDataMember(int pid, int member, ProtoDataMemberValue* value);
int protoInit();
void protoReset();