Prev: 54476 Up: Map Next: 54554
54511: Check Object Match Criteria
Used by the routines at CountObjectsInLocation and FindMatchingObject.
Sets the carry when the object matches the id, the location and the remaining checks. Returns with the carry clear when any check fails.
Input
A Object ID
B Location ID
Output
F Carry flag set if object matches all criteria (location, visibility, type, etc.)
CheckObjectMatchCriteria 54511 CP (IY+1) Go to CheckObjectMatchCriteria_NoMatch if the object id does not match.
54514 JR NZ,CheckObjectMatchCriteria_NoMatch
54516 LD A,(41014) Go to CheckObjectMatchCriteria_NoMatch if the object is the character being processed.
54519 CP (IX+0)
54522 JR Z,CheckObjectMatchCriteria_NoMatch
54524 LD A,(IX+0) Go to CheckObjectMatchCriteria_NoMatch if the object is not in this location.
54527 CALL CheckObjectLocationMatch
54530 JR Z,CheckObjectMatchCriteria_NoMatch
54532 LD A,(IY+0) Jump to CheckObjectMatchCriteria_NoMatch if the character id is at least 2.
54535 CP 2
54537 JR NC,CheckObjectMatchCriteria_NoMatch
Perform final validation check.
54539 LD A,(41014) Read the current character.
54542 PUSH IX
54544 POP HL
54545 CALL 53880 Call 53880 to perform an additional validation check.
54548 JR C,CheckObjectMatchCriteria_NoMatch Go to CheckObjectMatchCriteria_NoMatch if 53880 sets the carry.
All checks passed - object matches the criteria.
54550 SCF Mark the condition as met.
54551 RET Return.
Clear the carry so an object that failed the checks returns as no match.
Object doesn't match any criteria.
CheckObjectMatchCriteria_NoMatch 54552 AND A Clear the carry before returning the failed object match.
54553 RET Return.
Prev: 54476 Up: Map Next: 54554