summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-09-03 11:06:39 -0400
committerscnorton <scnorton@biociphers.org>2017-09-03 11:06:39 -0400
commit0849f5637d2aa2b9feebd9dce27cf9cb64754d4a (patch)
treeee6f5b3903565ec4bb8912fcd85aa789237892f3
parent927df6fb3e61b94eee3ceffb08ce0e9d5db2c71e (diff)
sub_804DB2C
-rw-r--r--asm/trade.s32
-rw-r--r--include/trade.h1
-rw-r--r--src/trade.c8
3 files changed, 9 insertions, 32 deletions
diff --git a/asm/trade.s b/asm/trade.s
index 5d8dcbe19..8b1162583 100644
--- a/asm/trade.s
+++ b/asm/trade.s
@@ -5395,38 +5395,6 @@ _0804DAD0: .4byte gEnemyParty
.section .text.sub_804DB2C
- thumb_func_start sub_804DB2C
-sub_804DB2C: @ 804DB2C
- push {r4-r6,lr}
- ldr r6, _0804DB58 @ =gSpecialVar_0x8005
- ldrh r0, [r6]
- movs r5, 0x64
- muls r0, r5
- ldr r4, _0804DB5C @ =gPlayerParty
- adds r0, r4
- movs r1, 0x2D
- bl GetMonData
- cmp r0, 0
- bne _0804DB60
- ldrh r0, [r6]
- muls r0, r5
- adds r0, r4
- movs r1, 0xB
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- b _0804DB62
- .align 2, 0
-_0804DB58: .4byte gSpecialVar_0x8005
-_0804DB5C: .4byte gPlayerParty
-_0804DB60:
- movs r0, 0
-_0804DB62:
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_804DB2C
-
thumb_func_start sub_804DB68
sub_804DB68: @ 804DB68
push {lr}
diff --git a/include/trade.h b/include/trade.h
index 04f474194..591c50e8a 100644
--- a/include/trade.h
+++ b/include/trade.h
@@ -6,5 +6,6 @@
#define POKERUBY_TRADE_H
void sub_8047CD8(void);
+u16 sub_804DB2C(void);
#endif //POKERUBY_TRADE_H
diff --git a/src/trade.c b/src/trade.c
index 0eb05bb52..6b85ecb05 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -24,6 +24,7 @@
#include "rom4.h"
#include "rom_8077ABC.h"
#include "daycare.h"
+#include "event_data.h"
#include "trade.h"
#ifdef ENGLISH
@@ -3155,3 +3156,10 @@ asm(".section .text.sub_804DAD4");
arg0->species = trade->species;
arg0->heldItem = trade->heldItem;
}
+
+u16 sub_804DB2C(void)
+{
+ if (GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_IS_EGG))
+ return SPECIES_NONE;
+ return GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_SPECIES);
+}