From 4fecf6381cc365ce7fd0d1d48ae027d0e0d51ab6 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Thu, 19 Feb 2004 07:51:14 +0000 Subject: [PATCH] Space Marines die if on board a self-destructing Scout, from Nic (fixes bug #445) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1324 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/ships/orz/orz.c | 4 ++-- sc2/src/sc2code/ships/shofixti/shofixti.c | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 18c90a20a..14ac883a1 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.4: +- Space marines die in a self-destructing Scout (Bug #445), from Nic - Added the -l option to produce logfiles (bug #560), from Nic - Zoq-Fot-Pik speech properly vertically centered (bug #579), from Nic - Input code refactoring, phase 2: All player input is brokered by diff --git a/sc2/src/sc2code/ships/orz/orz.c b/sc2/src/sc2code/ships/orz/orz.c index 4aeb56c3a..d41e81145 100644 --- a/sc2/src/sc2code/ships/orz/orz.c +++ b/sc2/src/sc2code/ships/orz/orz.c @@ -349,7 +349,7 @@ static void marine_preprocess (PELEMENT ElementPtr); #define MARINE_WAIT 12 -static void +void intruder_preprocess (PELEMENT ElementPtr) { HELEMENT hElement, hNextElement; @@ -706,7 +706,7 @@ PELEMENT ElementPtr; } } -static void +void marine_collision (PELEMENT ElementPtr0, PPOINT pPt0, PELEMENT ElementPtr1, PPOINT pPt1) { if (ElementPtr0->life_span diff --git a/sc2/src/sc2code/ships/shofixti/shofixti.c b/sc2/src/sc2code/ships/shofixti/shofixti.c index c461bdc60..a17b5dbfd 100644 --- a/sc2/src/sc2code/ships/shofixti/shofixti.c +++ b/sc2/src/sc2code/ships/shofixti/shofixti.c @@ -203,6 +203,13 @@ destruct_preprocess (PELEMENT ElementPtr) } } +/* In order to detect any Orz Marines that have boarded the ship + when it self-destructs, we'll need to see these Orz functions */ +void intruder_preprocess (PELEMENT); +void marine_collision (PELEMENT, PPOINT, PELEMENT, PPOINT); +#define ORZ_MARINE(ptr) (ptr->preprocess_func == intruder_preprocess && \ + ptr->collision_func == marine_collision) + static void self_destruct (PELEMENT ElementPtr) { @@ -250,7 +257,7 @@ self_destruct (PELEMENT ElementPtr) LockElement (hElement, &ObjPtr); hNextElement = GetSuccElement (ObjPtr); - if (CollidingElement (ObjPtr)) + if (CollidingElement (ObjPtr) || ORZ_MARINE (ObjPtr)) { #define DESTRUCT_RANGE 180 SIZE delta_x, delta_y;