diff --git a/ai.asm b/ai.asm index d660a36..535280f 100644 --- a/ai.asm +++ b/ai.asm @@ -437,9 +437,10 @@ loop01 beq skipThisPlayer lda eXistenZ,y beq skipThisPlayer - lda BarrelLength,y - cmp #LongBarrel ; if target has Long Schlong do not aim - beq skipThisPlayer + ; moved to CheckTeamMember for optimization + ;lda BarrelLength,y + ;cmp #LongBarrel ; if target has Long Schlong do not aim + ;beq skipThisPlayer jsr CheckTeamMember bcc skipThisPlayer ; if the same Team lda skilltable,y @@ -501,9 +502,10 @@ loop01 beq skipThisPlayer lda eXistenZ,y beq skipThisPlayer - lda BarrelLength,y - cmp #LongBarrel ; if target has Long Schlong do not aim - beq skipThisPlayer + ; moved to CheckTeamMember for optimization + ;lda BarrelLength,y + ;cmp #LongBarrel ; if target has Long Schlong do not aim + ;beq skipThisPlayer jsr CheckTeamMember bcc skipThisPlayer ; if the same Team lda LowResDistances,x @@ -822,9 +824,10 @@ SetNextTarget beq skipThisPlayer lda eXistenZ,y beq skipThisPlayer - lda BarrelLength,y - cmp #LongBarrel ; if target has Long Schlong do not aim - beq skipThisPlayer + ; moved to CheckTeamMember for optimization + ;lda BarrelLength,y + ;cmp #LongBarrel ; if target has Long Schlong do not aim + ;beq skipThisPlayer jsr CheckTeamMember bcc skipThisPlayer ; if the same Team ; check target direction @@ -852,6 +855,11 @@ TankHit .proc CheckTeamMember ; Target tank number in Y ; result in C bit ; 0 - the same Team ; 1 - another Team + ; optimization + lda #LongBarrel-1 + cmp BarrelLength,y ; if target has Long Schlong do not aim + bcc SchlongIsLong + ; end of optimization sec ; if there is no team play, then as a member of another team bit TeamGame ; if teams game bvc no_teams @@ -859,6 +867,7 @@ TankHit eor TankNr ror ; check lower bits of tank numbers (team) no_teams +SchlongIsLong rts .endp ;---------------------------------------------- diff --git a/scorch.xex b/scorch.xex index 5498bd6..d250351 100644 Binary files a/scorch.xex and b/scorch.xex differ