- next round of refactoring.

This contains some advance work for handling line-to-line portals in A_PainShootSkull.
This function is special because it performs a map check itself instead of using one of the common functions from p_map.cpp, like most of the rest of the game code.
This commit is contained in:
Christoph Oelckers 2016-01-18 16:49:24 +01:00
commit 2b5e5b6bc3
8 changed files with 93 additions and 52 deletions

View file

@ -145,7 +145,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
P_CheckSplash(self, 128<<FRACBITS);
// Now launch mushroom cloud
AActor *target = Spawn("Mapspot", 0, 0, 0, NO_REPLACE); // We need something to aim at.
AActor *target = Spawn("Mapspot", self->X(), self->Y(), self->Z(), NO_REPLACE); // We need something to aim at.
AActor *master = (flags & MSF_DontHurt) ? (AActor*)(self->target) : self;
target->height = self->height;
for (i = -n; i <= n; i += 8)
@ -153,9 +153,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
for (j = -n; j <= n; j += 8)
{
AActor *mo;
target->x = self->x + (i << FRACBITS); // Aim in many directions from source
target->y = self->y + (j << FRACBITS);
target->z = self->z + (P_AproxDistance(i,j) * vrange); // Aim up fairly high
target->x = self->X() + (i << FRACBITS); // Aim in many directions from source
target->y = self->Y() + (j << FRACBITS);
target->z = self->Z() + (P_AproxDistance(i,j) * vrange); // Aim up fairly high
if ((flags & MSF_Classic) || // Flag explicitely set, or no flags and compat options
(flags == 0 && (self->state->DefineFlags & SDF_DEHACKED) && (i_compatflags & COMPATF_MUSHROOM)))
{ // Use old function for MBF compatibility