Decompile aibotGiveDualWeapon

This commit is contained in:
Ryan Dwyer
2020-03-12 17:11:56 +10:00
parent 367bf940d9
commit 057eb2e0a6
3 changed files with 18 additions and 25 deletions
+3 -3
View File
@@ -574,7 +574,7 @@ u32 propobjHandlePickupByAibot(struct prop *prop, struct chrdata *chr)
&& weapondef
&& (weapondef->flags & WEAPONFLAG_DUALWIELD)
&& originalpad != currentpad) {
chrGiveDualWeapon(chr, weapon->weapon_id);
aibotGiveDualWeapon(chr, weapon->weapon_id);
result = 1;
} else {
result = 2;
@@ -3730,7 +3730,7 @@ glabel var7f1b8f50
/* f1938ac: 27b100f4 */ addiu $s1,$sp,0xf4
.L0f1938b0:
/* f1938b0: 03c02025 */ or $a0,$s8,$zero
/* f1938b4: 0fc65f3c */ jal func0f197cf0
/* f1938b4: 0fc65f3c */ jal aibotGetInvItem
/* f1938b8: 8e650000 */ lw $a1,0x0($s3)
/* f1938bc: 26100004 */ addiu $s0,$s0,0x4
/* f1938c0: 26940001 */ addiu $s4,$s4,0x1
@@ -5098,7 +5098,7 @@ glabel var7f1b8fc8
/* f194d1c: 004fc823 */ subu $t9,$v0,$t7
/* f194d20: 1f20003f */ bgtz $t9,.L0f194e20
/* f194d24: ae5900cc */ sw $t9,0xcc($s2)
/* f194d28: 0fc65f3c */ jal func0f197cf0
/* f194d28: 0fc65f3c */ jal aibotGetInvItem
/* f194d2c: 8e450020 */ lw $a1,0x20($s2)
/* f194d30: 00408025 */ or $s0,$v0,$zero
/* f194d34: 0fc4a2bd */ jal weaponGetModel
+13 -20
View File
@@ -487,7 +487,7 @@ glabel func0f197c70
);
GLOBAL_ASM(
glabel func0f197cf0
glabel aibotGetInvItem
/* f197cf0: 10800004 */ beqz $a0,.L0f197d04
/* f197cf4: 00a03825 */ or $a3,$a1,$zero
/* f197cf8: 8c8202d4 */ lw $v0,0x2d4($a0)
@@ -606,7 +606,7 @@ glabel chrHasWeapon
/* f197e58: 10000008 */ beqz $zero,.L0f197e7c
/* f197e5c: 00001025 */ or $v0,$zero,$zero
.L0f197e60:
/* f197e60: 0fc65f3c */ jal func0f197cf0
/* f197e60: 0fc65f3c */ jal aibotGetInvItem
/* f197e64: 00000000 */ sll $zero,$zero,0x0
/* f197e68: 50400004 */ beqzl $v0,.L0f197e7c
/* f197e6c: 00001025 */ or $v0,$zero,$zero
@@ -659,27 +659,20 @@ glabel func0f197e8c
/* f197f00: 00000000 */ sll $zero,$zero,0x0
);
GLOBAL_ASM(
glabel chrGiveDualWeapon
/* f197f04: 27bdffe8 */ addiu $sp,$sp,-24
/* f197f08: afbf0014 */ sw $ra,0x14($sp)
/* f197f0c: 0fc65f3c */ jal func0f197cf0
/* f197f10: 00000000 */ sll $zero,$zero,0x0
/* f197f14: 10400002 */ beqz $v0,.L0f197f20
/* f197f18: 240e0003 */ addiu $t6,$zero,0x3
/* f197f1c: ac4e0000 */ sw $t6,0x0($v0)
.L0f197f20:
/* f197f20: 8fbf0014 */ lw $ra,0x14($sp)
/* f197f24: 27bd0018 */ addiu $sp,$sp,0x18
/* f197f28: 03e00008 */ jr $ra
/* f197f2c: 00000000 */ sll $zero,$zero,0x0
);
void aibotGiveDualWeapon(struct chrdata *chr, u32 weaponnum)
{
struct invitem *item = aibotGetInvItem(chr, weaponnum);
if (item) {
item->type = INVITEMTYPE_3;
}
}
GLOBAL_ASM(
glabel chrGetWeaponPad
/* f197f30: 27bdffe8 */ addiu $sp,$sp,-24
/* f197f34: afbf0014 */ sw $ra,0x14($sp)
/* f197f38: 0fc65f3c */ jal func0f197cf0
/* f197f38: 0fc65f3c */ jal aibotGetInvItem
/* f197f3c: 00000000 */ sll $zero,$zero,0x0
/* f197f40: 10400007 */ beqz $v0,.L0f197f60
/* f197f44: 8fbf0014 */ lw $ra,0x14($sp)
@@ -730,7 +723,7 @@ glabel chrGiveWeapon
/* f197fd8: 10400019 */ beqz $v0,.L0f198040
/* f197fdc: afa2002c */ sw $v0,0x2c($sp)
/* f197fe0: 02602025 */ or $a0,$s3,$zero
/* f197fe4: 0fc65f3c */ jal func0f197cf0
/* f197fe4: 0fc65f3c */ jal aibotGetInvItem
/* f197fe8: 02002825 */ or $a1,$s0,$zero
/* f197fec: 86390006 */ lh $t9,0x6($s1)
/* f197ff0: 10000013 */ beqz $zero,.L0f198040
@@ -2307,7 +2300,7 @@ glabel func0f1994b0
/* f199508: 02402025 */ or $a0,$s2,$zero
/* f19950c: 51e10009 */ beql $t7,$at,.L0f199534
/* f199510: 8fb90064 */ lw $t9,0x64($sp)
/* f199514: 0fc65f3c */ jal func0f197cf0
/* f199514: 0fc65f3c */ jal aibotGetInvItem
/* f199518: 01e02825 */ or $a1,$t7,$zero
/* f19951c: 14400004 */ bnez $v0,.L0f199530
/* f199520: afa2005c */ sw $v0,0x5c($sp)
+2 -2
View File
@@ -7,11 +7,11 @@ u32 func0f197600(void);
void mpAibotApplyCommand(struct chrdata *chr, u32 command);
void func0f197c00(struct chrdata *chr);
u32 func0f197c70(void);
u32 func0f197cf0(void);
struct invitem *aibotGetInvItem(struct chrdata *chr, u32 weaponnum);
u32 func0f197d94(void);
bool chrHasWeapon(struct chrdata *chr, u32 weaponnum);
u32 func0f197e8c(void);
void chrGiveDualWeapon(struct chrdata *chr, u32 weaponnum);
void aibotGiveDualWeapon(struct chrdata *chr, u32 weaponnum);
u32 chrGetWeaponPad(struct chrdata *chr, u32 weaponnum);
void chrGiveWeapon(struct chrdata *chr, struct prop *prop);
u32 func0f198068(void);