From 283d5971feaac4e1e7eee088b30b403925bdb2a7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 24 May 2006 13:11:30 +0000 Subject: [PATCH] - Fixed: A_SpawnItem performed an integer multiplication with fixed point values to calculate the spawn position. - Fixed: A_SpawnItem tried to set the spawned actor's angle before checking the validity of the returned pointer. SVN r141 (trunk) --- docs/rh-log.txt | 6 ++++++ src/thingdef_codeptr.cpp | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f3f28541d..7104d0dc6 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +May 24, 2006 (Changes by Graf Zahl) +- Fixed: A_SpawnItem performed an integer multiplication with fixed point + values to calculate the spawn position. +- Fixed: A_SpawnItem tried to set the spawned actor's angle before checking + the validity of the returned pointer. + May 23, 2006 - Added missing linker dependencies for Visual C++ 2005 Express Edition and fixed building of the assembly files when the source is located in a path diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index 0b3509b0b..4b5ed642b 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -1110,15 +1110,15 @@ void A_SpawnItem(AActor * self) } AActor * mo = Spawn( missile, - self->x + distance*finecosine[self->angle>>ANGLETOFINESHIFT], - self->y + distance*finesine[self->angle>>ANGLETOFINESHIFT], + self->x + FixedMul(distance, finecosine[self->angle>>ANGLETOFINESHIFT]), + self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]), self->z - self->floorclip + zheight); - mo->angle=self->angle; if (mo) { AActor * originator = self; + mo->angle=self->angle; while (originator && isMissile(originator)) originator = originator->target; if (mo->flags3&MF3_ISMONSTER)