From b663aae91f3826d87fdd917f863ad791717881c1 Mon Sep 17 00:00:00 2001 From: Vin Bertinelli Date: Fri, 11 Jan 2019 20:42:21 -0500 Subject: [PATCH] eggs - add left/right raycasts as well add left/right raycasts to ensure egg wont spawn on a ledge --- ASM/Custom Events/Custom Event Code.asm | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/ASM/Custom Events/Custom Event Code.asm b/ASM/Custom Events/Custom Event Code.asm index f46c69e3..49f81f58 100644 --- a/ASM/Custom Events/Custom Event Code.asm +++ b/ASM/Custom Events/Custom Event Code.asm @@ -1257,13 +1257,13 @@ b exit EggsThinkSpawn: .if debug==1 - li r24,0 #Init loop count + li r24,0 #Init loop count .endif EggsThinkSpawnLoop: .if debug==1 - addi r24,r24,1 #Inc Loop Count + addi r24,r24,1 #Inc Loop Count .endif #Get OnScreen Boundaries @@ -1313,12 +1313,28 @@ b exit bl FindGroundUnderCoordinate cmpwi r3,0x0 beq EggsThinkSpawnLoop + #Check Left + li r3,2 + bl IntToFloat + fsubs f1,f21,f1 + fmr f2,f22 + bl FindGroundUnderCoordinate + cmpwi r3,0x0 + beq EggsThinkSpawnLoop + #Check Right + li r3,2 + bl IntToFloat + fadds f1,f21,f1 + fmr f2,f22 + bl FindGroundUnderCoordinate + cmpwi r3,0x0 + beq EggsThinkSpawnLoop .if debug==1 - #OSReport Loop Count - load r3,0x803ead3c - mr r4,r24 - branchl r12,OSReport + #OSReport Loop Count + load r3,0x803ead3c + mr r4,r24 + branchl r12,OSReport .endif SpawnEgg: