mirror of
				https://github.com/thornAvery/kep-hack.git
				synced 2025-11-04 20:51:02 +13:00 
			
		
		
		
	Merge pull request #42 from jojo-kep/master
Fix for static wild mons not being hidden
This commit is contained in:
		
						commit
						aa6e47e4a3
					
				| 
						 | 
				
			
			@ -6981,6 +6981,9 @@ PlayMoveAnimation:
 | 
			
		|||
	predef_jump MoveAnimation
 | 
			
		||||
 | 
			
		||||
InitBattle::
 | 
			
		||||
	xor a
 | 
			
		||||
	ld [wWasTrainerBattle], a 	;Remember to clear wWasTrainerBattle from any previous battles, 
 | 
			
		||||
								;because this new  battle could be a static wild encounter.
 | 
			
		||||
	ld a, [wCurOpponent]
 | 
			
		||||
	and a
 | 
			
		||||
	jr z, DetermineWildOpponent
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -142,20 +142,20 @@ HideObject:
 | 
			
		|||
	ld c, a
 | 
			
		||||
	ld b, FLAG_SET
 | 
			
		||||
	call MissableObjectFlagAction   ; set "removed" flag
 | 
			
		||||
	call VerifyObjectState
 | 
			
		||||
	jr z, HideObject
 | 
			
		||||
;	call VerifyObjectState
 | 
			
		||||
;	jr z, HideObject
 | 
			
		||||
	jp UpdateSprites
 | 
			
		||||
 | 
			
		||||
;returns z flag set if shown and z flag cleared if hidden
 | 
			
		||||
VerifyObjectState:
 | 
			
		||||
	ld hl, wMissableObjectFlags
 | 
			
		||||
	ld a, [wMissableObjectIndex]
 | 
			
		||||
	ld c, a
 | 
			
		||||
	ld b, FLAG_TEST
 | 
			
		||||
	call MissableObjectFlagAction  
 | 
			
		||||
	ld a, c
 | 
			
		||||
	and a
 | 
			
		||||
	ret
 | 
			
		||||
;VerifyObjectState:
 | 
			
		||||
;	ld hl, wMissableObjectFlags
 | 
			
		||||
;	ld a, [wMissableObjectIndex]
 | 
			
		||||
;	ld c, a
 | 
			
		||||
;	ld b, FLAG_TEST
 | 
			
		||||
;	call MissableObjectFlagAction  
 | 
			
		||||
;	ld a, c
 | 
			
		||||
;	and a
 | 
			
		||||
;	ret
 | 
			
		||||
	
 | 
			
		||||
MissableObjectFlagAction:
 | 
			
		||||
; identical to FlagAction
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue