mirror of
https://github.com/alexbatalov/fallout2-ce.git
synced 2024-11-19 14:11:15 +00:00
Add proto_is_subtype
This commit is contained in:
parent
d27eafe03a
commit
ccabbd7688
17
src/proto.cc
17
src/proto.cc
@ -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)
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user