From e2600910641e8d072f6f884bb34977e700cd834d Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Sun, 13 Jan 2019 21:17:17 +0100 Subject: [PATCH] Fix bug when two ships collide and simultaneously hit a sun. The problem is that the MP1 loop assumes that the object type in the C accumulator stays constant. When the ships collide, one is changed to a fireball, and the other is erased. When the collision with the sun is detected, the object type in C is still "ship". Getting C fresh each time at MP2 fixes the bug. --- src/spcwar/{spcwar.165 => spcwar.166} | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) rename src/spcwar/{spcwar.165 => spcwar.166} (99%) diff --git a/src/spcwar/spcwar.165 b/src/spcwar/spcwar.166 similarity index 99% rename from src/spcwar/spcwar.165 rename to src/spcwar/spcwar.166 index 67428c79..e6e2fece 100644 --- a/src/spcwar/spcwar.165 +++ b/src/spcwar/spcwar.166 @@ -1334,11 +1334,10 @@ IFN $ITS,[ SETZ MP1, ML1: SKIPN OBJFLG(MP1) JRST MQ1 ;object is not active - SKIPG C,OBJFLG(MP1) - JRST MQ4 ;object is not collideable MOVEI MP2,1(MP1) ;start with objects after this one -ML2: SKIPG D,OBJFLG(MP2) - JRST MQ2B ;obj cannot collide +ML2: SKIPLE C,OBJFLG(MP1) + SKIPG D,OBJFLG(MP2) + JRST MQ2B ;obj cannot collide MOVE A,OBJX(MP1) ;compute distance between them FSBR A,OBJX(MP2) MOVM A,A @@ -1357,7 +1356,6 @@ ML2: SKIPG D,OBJFLG(MP2) ; Collision! - find types - PUSH P,C PUSH P,MP1 PUSH P,MP2 HLRZS C @@ -1371,13 +1369,12 @@ ML2: SKIPG D,OBJFLG(MP2) PUSHJ P,@COLTBL(C) ;VECTOR TO APPROPRIATE RTN POP P,MP2 POP P,MP1 - POP P,C MQ2B: CAIGE MP2,OBJCTS-1 ;check for more collisions here AOJA MP2,ML2 ;go do more collisions for this object ;now create display list for object -MQ4: SKIPE A,OBJFLG(MP1) ;in case object was removed in coll. + SKIPE A,OBJFLG(MP1) ;in case object was removed in coll. PUSHJ P,(A) ;make the list and other random functions MQ1: CAIGE MP1,OBJCTS-2 ;next to last object AOJA MP1,ML1 ; no - continue