mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed broken GetProto() function (again)
This commit is contained in:
@@ -534,16 +534,16 @@ Queue* QueueFind(TGameObj* object, long type) {
|
||||
|
||||
long AnimCodeByWeapon(TGameObj* weapon) {
|
||||
if (weapon != nullptr) {
|
||||
sProto* proto = nullptr;
|
||||
if (GetProto(weapon->protoId, proto) && proto->item.type == item_type_weapon) {
|
||||
sProto* proto;
|
||||
if (GetProto(weapon->protoId, &proto) && proto->item.type == item_type_weapon) {
|
||||
return proto->item.weapon.animationCode;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool GetProto(long pid, sProto* outProto) {
|
||||
return (fo_proto_ptr(pid, &outProto) != -1);
|
||||
bool GetProto(long pid, sProto** outProto) {
|
||||
return (fo_proto_ptr(pid, outProto) != -1);
|
||||
}
|
||||
|
||||
void SkillGetTags(long* result, long num) {
|
||||
|
||||
@@ -508,7 +508,7 @@ Queue* QueueFind(TGameObj* object, long type);
|
||||
long AnimCodeByWeapon(TGameObj* weapon);
|
||||
|
||||
// returns False if the prototype does not exist, or pointer to prototype by PID in the outProto argument
|
||||
bool GetProto(long pid, sProto* outProto);
|
||||
bool GetProto(long pid, sProto** outProto);
|
||||
|
||||
// returns pointer to prototype by PID, or nullptr on get failure
|
||||
// NOTE: not an efficient construction
|
||||
|
||||
+3
-3
@@ -101,12 +101,12 @@ DWORD __stdcall sfgame_adjust_fid() {
|
||||
// vanilla logic:
|
||||
indexNum = *ptr_art_vault_guy_num;
|
||||
sProto* critterPro;
|
||||
if (GetProto(*ptr_inven_pid, critterPro)) {
|
||||
if (GetProto(*ptr_inven_pid, &critterPro)) {
|
||||
indexNum = critterPro->fid & 0xFFF;
|
||||
}
|
||||
if (*ptr_i_worn != nullptr) {
|
||||
sProto* armorPro;
|
||||
GetProto((*ptr_i_worn)->protoId, armorPro);
|
||||
GetProto((*ptr_i_worn)->protoId, &armorPro);
|
||||
DWORD armorFid = fo_stat_level(*ptr_inven_dude, STAT_gender) == GENDER_FEMALE
|
||||
? armorPro->item.armor.femaleFID
|
||||
: armorPro->item.armor.maleFID;
|
||||
@@ -122,7 +122,7 @@ DWORD __stdcall sfgame_adjust_fid() {
|
||||
|
||||
if (itemInHand != nullptr) {
|
||||
sProto* itemPro;
|
||||
if (GetProto(itemInHand->protoId, itemPro) && itemPro->item.type == item_type_weapon) {
|
||||
if (GetProto(itemInHand->protoId, &itemPro) && itemPro->item.type == item_type_weapon) {
|
||||
weaponAnimCode = itemPro->item.weapon.animationCode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user