diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f3b83179..92bdaf8e 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,52 @@ +January 18, 2009 (Changes by Graf Zahl) +- Added a CopyInfo function to FTexture that contains all code required to + clone a texture. Used for creating warping textures. +- Fixed: P_FindFloorCeiling should not be called before setting the actor's z- + coordinate. For testing 3D Midtex lines and 3D floors the proper position + needs to be set first. +- Fixed the autoaim fix from Jan 10. + +January 11, 2009 (Changes by Graf Zahl) +- Added option to specify the amount of ammo to be given by a WeaponGiver. + +January 10, 2009 (Changes by Graf Zahl) +- fixed: Identification of Doom1 Freedoom IWAD did not work. +- fixed: UDMF did not initialize a sector's light colors. +- fixed implementation of DF2_NOAUTOAIM flag. + +January 7, 2009 (Changes by Graf Zahl) +- copied some 3D floor fixes from GZDoom. +- fixed: Crushing polyobject did incomplete checks for blocked moves. + +January 5, 2009 (Changes by Graf Zahl) +- fixed: Parsing of color strings with 6 characters and spaces did not work. +- fixed: State labels must be evaluated for the state's owner, not the calling actor. + +January 4, 2009 (Changes by Graf Zahl) +- Fixed: For map spawns any change to an actor's floor z-coordinate must be + delayed until after its z-coordinate has been set. That means that for + map spawns AActor::StaticSpawn may not call P_FindFloorCeiling for such + actors. +- added GZDoom's 3D floor physics code. This is not active yet so anything + compiled from this code won't have any support for it! +- Used new functionality to avoid moving the puff around in SpawnDeepSplash. +- Fixed: P_RailAttack used the shooting actor or a default puff for some splash + related actions. It should use the puff type passed to it as a parameter instead. +- Changed splash handling in P_LineAttack to use the actual hit position to + spawn the splash and not the puff's spawn position which is offset a little. +- made some precision related changes to P_HitWater. The precise hit coordinate + can now be passed as parameters. + +January 3, 2009 (Changes by Graf Zahl) +- Made spawning of floor- and ceiling huggers a little more intelligent. +- Fixed: 'None' was no longer recognized as a NULL class name by the + DECORATE parser. + +January 1, 2009 (Changes by Graf Zahl) +- Added 'ininventory item, amount' option to SBARINFO to check for a minimum + amount instead of mere presence in the inventory. +- Fixed: Door lock messages were overwritten by remote messages. + January 1, 2009 (Changes by Graf Zahl) - Fixed: SBARINFO used GetSpecies instead of GetClass to check weapon types. - Added a few missing NULL pointer checks to SBARINFO code. diff --git a/src/d_main.cpp b/src/d_main.cpp index fd6a2208..98cb0cd8 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -479,19 +479,6 @@ CUSTOM_CVAR (Int, dmflags2, 0, CVAR_SERVERINFO) if (p->cheats & CF_CHASECAM) cht_DoCheat (p, CHT_CHASECAM); } - - // Change our autoaim settings if need be. - if (dmflags2 & DF2_NOAUTOAIM) - { - // Save our aimdist and set aimdist to 0. - p->userinfo.savedaimdist = p->userinfo.aimdist; - p->userinfo.aimdist = 0; - } - else - { - // Restore our aimdist. - p->userinfo.aimdist = p->userinfo.savedaimdist; - } } } @@ -1634,18 +1621,15 @@ static EIWADType ScanIWAD (const char *iwad) } else { + if (lumpsfound[Check_FreeDoom]) + { + return IWAD_FreeDoom1; + } for (i = Check_e2m1; i < NUM_CHECKLUMPS; i++) { if (!lumpsfound[i]) { - if (lumpsfound[Check_FreeDoom]) - { - return IWAD_FreeDoom1; - } - else - { - return IWAD_DoomShareware; - } + return IWAD_DoomShareware; } } if (i == NUM_CHECKLUMPS) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 6f5b331c..cb097d59 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -370,17 +370,11 @@ void D_SetupUserInfo () } if (autoaim > 35.f || autoaim < 0.f) { - if (dmflags & DF2_NOAUTOAIM) - coninfo->savedaimdist = ANGLE_1*35; - else - coninfo->aimdist = ANGLE_1*35; + coninfo->aimdist = ANGLE_1*35; } else { - if (dmflags & DF2_NOAUTOAIM) - coninfo->savedaimdist = abs ((int)(autoaim * (float)ANGLE_1)); - else - coninfo->aimdist = abs ((int)(autoaim * (float)ANGLE_1)); + coninfo->aimdist = abs ((int)(autoaim * (float)ANGLE_1)); } coninfo->color = color; coninfo->skin = R_FindSkin (skin, 0); @@ -690,16 +684,10 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update) angles = atof (value); if (angles > 35.f || angles < 0.f) { - if (dmflags & DF2_NOAUTOAIM) - info->savedaimdist = ANGLE_1*35; - else info->aimdist = ANGLE_1*35; } else { - if (dmflags & DF2_NOAUTOAIM) - info->savedaimdist = abs ((int)(angles * (float)ANGLE_1)); - else info->aimdist = abs ((int)(angles * (float)ANGLE_1)); } } @@ -816,8 +804,11 @@ FArchive &operator<< (FArchive &arc, userinfo_t &info) arc.Read (&info.netname, sizeof(info.netname)); } arc << info.team << info.aimdist << info.color << info.skin << info.gender << info.neverswitch; - if (SaveVersion >= 1333) arc << info.savedaimdist; - else info.savedaimdist = info.aimdist; + if (SaveVersion >= 1333 && SaveVersion <= 1355) + { + int savedaimdist; + arc << savedaimdist; + } return arc; } diff --git a/src/d_player.h b/src/d_player.h index 1d33a99a..b7adf786 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -27,6 +27,7 @@ // is buffered within the player data struct, // as commands per game tick. #include "d_ticcmd.h" +#include "doomstat.h" #include "a_artifacts.h" @@ -197,7 +198,6 @@ struct userinfo_t { char netname[MAXPLAYERNAME+1]; BYTE team; - int savedaimdist; int aimdist; int color; int skin; @@ -205,6 +205,8 @@ struct userinfo_t bool neverswitch; fixed_t MoveBob, StillBob; int PlayerClass; + + int GetAimDist() const { return (dmflags2 & DF2_NOAUTOAIM)? 0 : aimdist; } }; FArchive &operator<< (FArchive &arc, userinfo_t &info); diff --git a/src/dobjtype.h b/src/dobjtype.h index 98092d60..88defaef 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -72,7 +72,7 @@ struct PSymbolVariable : public PSymbol // parameters passed. struct FState; struct StateCallData; -typedef void (*actionf_p)(AActor *self, FState *state, int parameters, StateCallData *statecall); +typedef void (*actionf_p)(AActor *self, AActor *stateowner, FState *state, int parameters, StateCallData *statecall); struct PSymbolActionFunction : public PSymbol { diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index ac4e0a0e..39128fdf 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -452,9 +452,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG) { return; } - // [RH] bfg can be forced to not use freeaim - angle_t storedpitch = self->pitch; - int storedaimdist = player->userinfo.aimdist; AWeapon *weapon = self->player->ReadyWeapon; if (weapon != NULL) @@ -463,14 +460,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG) return; } - if (dmflags2 & DF2_NO_FREEAIMBFG) - { - self->pitch = 0; - player->userinfo.aimdist = ANGLE_1*35; - } - P_SpawnPlayerMissile (self, PClass::FindClass("BFGBall")); - self->pitch = storedpitch; - player->userinfo.aimdist = storedaimdist; + P_SpawnPlayerMissile (self, 0, 0, 0, PClass::FindClass("BFGBall"), self->angle, NULL, NULL, !!(dmflags2 & DF2_NO_FREEAIMBFG)); } // diff --git a/src/g_level.cpp b/src/g_level.cpp index bdf673c6..4a5ede75 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2907,12 +2907,10 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad) P_SerializeSounds (arc); STAT_SAVE(arc, hubLoad); - #ifdef _3DFLOORS - if (arc.IsLoading()) for(i=0;iItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only. + if (weap->AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1; + if (weap->AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2; bool res = weap->CallTryPickup(toucher); if (!res) weap->Destroy(); else GoAwayAndDie(); diff --git a/src/info.h b/src/info.h index 6debadfe..194546e4 100644 --- a/src/info.h +++ b/src/info.h @@ -104,11 +104,11 @@ struct FState if (setdefaultparams) ParameterIndex = 0; } } - inline bool CallAction(AActor *self, StateCallData *statecall = NULL) + inline bool CallAction(AActor *self, AActor *stateowner, StateCallData *statecall = NULL) { if (ActionFunc != NULL) { - ActionFunc(self, this, ParameterIndex-1, statecall); + ActionFunc(self, stateowner, this, ParameterIndex-1, statecall); return true; } else diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index 5da5089a..f66aed72 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -558,7 +558,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li fixed_t thingbot, thingtop; thingbot = thing->z; - thingtop = thingbot + thing->height; + thingtop = thingbot + (thing->height==0? 1:thing->height); extsector_t::xfloor *xf[2] = {&linedef->frontsector->e->XFloor, &linedef->backsector->e->XFloor}; @@ -575,16 +575,14 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li highestfloorpic.SetInvalid(); lowestceilingpic.SetInvalid(); - thingtop = thing->z + (thing->height==0? 1:thing->height); for(int j=0;j<2;j++) { - // Check for frontsector's 3D-floors for(unsigned i=0;iffloors.Size();i++) { F3DFloor *rover = xf[j]->ffloors[i]; - if (!(rover->flags&FF_EXISTS)) continue; + if (!(rover->flags & FF_EXISTS)) continue; if (!(rover->flags & FF_SOLID)) continue; fixed_t ff_bottom=rover->bottom.plane->ZatPoint(x, y); diff --git a/src/p_acs.cpp b/src/p_acs.cpp index f744809a..3769328f 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5372,7 +5372,7 @@ int DLevelScript::RunScript () switch (STACK(1)) { case PLAYERINFO_TEAM: STACK(2) = userinfo->team; break; - case PLAYERINFO_AIMDIST: STACK(2) = userinfo->aimdist; break; + case PLAYERINFO_AIMDIST: STACK(2) = userinfo->GetAimDist(); break; case PLAYERINFO_COLOR: STACK(2) = userinfo->color; break; case PLAYERINFO_GENDER: STACK(2) = userinfo->gender; break; case PLAYERINFO_NEVERSWITCH: STACK(2) = userinfo->neverswitch; break; diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 313de442..11205343 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -782,7 +782,7 @@ FUNC(LS_Teleport_NewMap) FUNC(LS_Teleport) // Teleport (tid, sectortag, bNoSourceFog) - { +{ return EV_Teleport (arg0, arg1, ln, backSide, it, true, !arg2, false); } diff --git a/src/p_local.h b/src/p_local.h index ff1bafa6..d88b64bd 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -122,7 +122,7 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type); AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type, angle_t angle); AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, const PClass *type, angle_t angle, - AActor **pLineTarget = NULL, AActor **MissileActor = NULL); + AActor **pLineTarget = NULL, AActor **MissileActor = NULL, bool nofreeaim = false); void P_CheckFakeFloorTriggers (AActor *mo, fixed_t oldz, bool oldz_has_viewheight=false); diff --git a/src/p_map.cpp b/src/p_map.cpp index 0672b81d..6935022c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2920,7 +2920,7 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **p // vrange of 0 degrees, because then toppitch and bottompitch will // be equal, and PTR_AimTraverse will never find anything to shoot at // if it crosses a line. - vrange = clamp (t1->player->userinfo.aimdist, ANGLE_1/2, ANGLE_1*35); + vrange = clamp (t1->player->userinfo.GetAimDist(), ANGLE_1/2, ANGLE_1*35); } } aim.toppitch = t1->pitch - vrange; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e8cc0da9..8d285617 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -521,7 +521,7 @@ bool AActor::SetState (FState *newstate) } } - if (newstate->CallAction(this)) + if (newstate->CallAction(this, this)) { // Check whether the called action function resulted in destroying the actor if (ObjectFlags & OF_EuthanizeMe) @@ -3217,13 +3217,27 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t if (G_SkillProperty(SKILLP_FastMonsters)) actor->Speed = actor->GetClass()->Meta.GetMetaFixed(AMETA_FastSpeed, actor->Speed); + // set subsector and/or block links actor->LinkToWorld (SpawningMapThing); + + actor->dropoffz = // killough 11/98: for tracking dropoffs + actor->floorz = actor->Sector->floorplane.ZatPoint (ix, iy); + actor->ceilingz = actor->Sector->ceilingplane.ZatPoint (ix, iy); + + // The z-coordinate needs to be set once before calling P_FindFloorCeiling + // For FLOATRANDZ just use the floor here. + if (iz == ONFLOORZ || iz == FLOATRANDZ) + { + actor->z = actor->floorz; + } + else if (iz == ONCEILINGZ) + { + actor->z = actor->ceilingz - actor->height; + } + if (SpawningMapThing || !type->IsDescendantOf (RUNTIME_CLASS(APlayerPawn))) { - actor->dropoffz = // killough 11/98: for tracking dropoffs - actor->floorz = actor->Sector->floorplane.ZatPoint (ix, iy); - actor->ceilingz = actor->Sector->ceilingplane.ZatPoint (ix, iy); actor->floorsector = actor->Sector; actor->floorpic = actor->floorsector->GetTexture(sector_t::floor); actor->ceilingsector = actor->Sector; @@ -3239,9 +3253,6 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t } else { - actor->floorz = FIXED_MIN; - actor->dropoffz = FIXED_MIN; - actor->ceilingz = FIXED_MAX; actor->floorpic = actor->Sector->GetTexture(sector_t::floor); actor->floorsector = actor->Sector; actor->ceilingpic = actor->Sector->GetTexture(sector_t::ceiling); @@ -4812,24 +4823,27 @@ AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type, angle_t angle) } AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, - const PClass *type, angle_t angle, AActor **pLineTarget, AActor **pMissileActor) + const PClass *type, angle_t angle, AActor **pLineTarget, AActor **pMissileActor, + bool nofreeaim) { static const int angdiff[3] = { -1<<26, 1<<26, 0 }; int i; angle_t an; angle_t pitch; AActor *linetarget; + int vrange = nofreeaim? ANGLE_1*35 : 0; // see which target is to be aimed at i = 2; do { an = angle + angdiff[i]; - pitch = P_AimLineAttack (source, an, 16*64*FRACUNIT, &linetarget); + pitch = P_AimLineAttack (source, an, 16*64*FRACUNIT, &linetarget, vrange); if (source->player != NULL && + !nofreeaim && level.IsFreelookAllowed() && - source->player->userinfo.aimdist <= ANGLE_1/2) + source->player->userinfo.GetAimDist() <= ANGLE_1/2) { break; } diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index dae12a86..70ee7bcb 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -99,7 +99,7 @@ void P_SetPsprite (player_t *player, int position, FState *state) if (player->mo != NULL) { - if (state->CallAction(player->mo)) + if (state->CallAction(player->mo, player->ReadyWeapon)) { if (!psp->state) { @@ -648,7 +648,7 @@ angle_t P_BulletSlope (AActor *mo, AActor **pLineTarget) if (mo->player != NULL && level.IsFreelookAllowed() && - mo->player->userinfo.aimdist <= ANGLE_1/2) + mo->player->userinfo.GetAimDist() <= ANGLE_1/2) { break; } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index b3521e14..94bfdc77 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -950,19 +950,36 @@ struct UDMFParser sec->ceilingplane.c = -FRACUNIT; sec->ceilingplane.ic = -FRACUNIT; - // [RH] Sectors default to white light with the default fade. - // If they are outside (have a sky ceiling), they use the outside fog. - if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special&0xff) == Sector_Outside)) + if (lightcolor == -1 && fadecolor == -1 && desaturation == -1) { - if (fogMap == NULL) - fogMap = GetSpecialLights (PalEntry (255,255,255), level.outsidefog, 0); - sec->ColorMap = fogMap; + // [RH] Sectors default to white light with the default fade. + // If they are outside (have a sky ceiling), they use the outside fog. + if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special&0xff) == Sector_Outside)) + { + if (fogMap == NULL) + fogMap = GetSpecialLights (PalEntry (255,255,255), level.outsidefog, 0); + sec->ColorMap = fogMap; + } + else + { + if (normMap == NULL) + normMap = GetSpecialLights (PalEntry (255,255,255), level.fadeto, NormalLight.Desaturate); + sec->ColorMap = normMap; + } } else { - if (normMap == NULL) - normMap = GetSpecialLights (PalEntry (255,255,255), level.fadeto, NormalLight.Desaturate); - sec->ColorMap = normMap; + if (lightcolor == -1) lightcolor = PalEntry(255,255,255); + if (fadecolor == -1) + { + if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special&0xff) == Sector_Outside)) + fadecolor = level.outsidefog; + else + fadecolor = level.fadeto; + } + if (desaturation == -1) desaturation = NormalLight.Desaturate; + + sec->ColorMap = GetSpecialLights (lightcolor, fadecolor, desaturation); } } diff --git a/src/svnrevision.h b/src/svnrevision.h index 0b205bc0..1b822b1b 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "1355" -#define ZD_SVN_REVISION_NUMBER 1355 +#define ZD_SVN_REVISION_STRING "1357" +#define ZD_SVN_REVISION_NUMBER 1357 diff --git a/src/textures/textures.h b/src/textures/textures.h index 91330232..4dab508b 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -220,6 +220,13 @@ protected: Span **CreateSpans (const BYTE *pixels) const; void FreeSpans (Span **spans) const; void CalcBitSize (); + void CopyInfo(FTexture *other) + { + CopySize(other); + bNoDecals = other->bNoDecals; + Rotations = other->Rotations; + gl_info = other->gl_info; + } static void FlipSquareBlock (BYTE *block, int x, int y); static void FlipSquareBlockRemap (BYTE *block, int x, int y, const BYTE *remap); diff --git a/src/textures/warptexture.cpp b/src/textures/warptexture.cpp index 6e30e036..f87688ea 100644 --- a/src/textures/warptexture.cpp +++ b/src/textures/warptexture.cpp @@ -43,9 +43,7 @@ FWarpTexture::FWarpTexture (FTexture *source) : GenTime (0), SourcePic (source), Pixels (0), Spans (0), Speed (1.f) { - CopySize(source); - bNoDecals = source->bNoDecals; - Rotations = source->Rotations; + CopyInfo(source); bWarped = 1; } diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index d2d4d921..14150d30 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -351,26 +351,26 @@ struct StateCallData // Macros to handle action functions. These are here so that I don't have to // change every single use in case the parameters change. -#define DECLARE_ACTION(name) void AF_##name(AActor *self, FState *, int, StateCallData *); +#define DECLARE_ACTION(name) void AF_##name(AActor *self, AActor *stateowner, FState *, int, StateCallData *); // This distinction is here so that CALL_ACTION produces errors when trying to // access a function that requires parameters. #define DEFINE_ACTION_FUNCTION(cls, name) \ - void AF_##name (AActor *self, FState *, int, StateCallData *); \ + void AF_##name (AActor *self, AActor *stateowner, FState *, int, StateCallData *); \ static AFuncDesc info_##cls##_##name = { #name, AF_##name }; \ MSVC_ASEG AFuncDesc *infoptr_##cls##_##name GCC_ASEG = &info_##cls##_##name; \ - void AF_##name (AActor *self, FState *, int, StateCallData *statecall) + void AF_##name (AActor *self, AActor *stateowner, FState *, int, StateCallData *statecall) #define DEFINE_ACTION_FUNCTION_PARAMS(cls, name) \ - void AFP_##name (AActor *self, FState *CallingState, int ParameterIndex, StateCallData *statecall); \ + void AFP_##name (AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall); \ static AFuncDesc info_##cls##_##name = { #name, AFP_##name }; \ MSVC_ASEG AFuncDesc *infoptr_##cls##_##name GCC_ASEG = &info_##cls##_##name; \ - void AFP_##name (AActor *self, FState *CallingState, int ParameterIndex, StateCallData *statecall) + void AFP_##name (AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall) -#define DECLARE_PARAMINFO AActor *self, FState *CallingState, int ParameterIndex, StateCallData *statecall -#define PUSH_PARAMINFO self, CallingState, ParameterIndex, statecall +#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall +#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall -#define CALL_ACTION(name,self) AF_##name(self, NULL, 0, NULL) +#define CALL_ACTION(name,self) AF_##name(self, self, NULL, 0, NULL) int EvalExpressionI (DWORD x, AActor *self); @@ -395,7 +395,7 @@ FName EvalExpressionName (DWORD x, AActor *self); #define ACTION_PARAM_CLASS(var,i) \ const PClass *var = EvalExpressionClass(ParameterIndex+i, self); #define ACTION_PARAM_STATE(var,i) \ - FState *var = EvalExpressionState(ParameterIndex+i, self); + FState *var = EvalExpressionState(ParameterIndex+i, stateowner); #define ACTION_PARAM_COLOR(var,i) \ PalEntry var = EvalExpressionCol(ParameterIndex+i, self); #define ACTION_PARAM_SOUND(var,i) \ diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 73345e06..f6344141 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -103,7 +103,7 @@ bool ACustomInventory::CallStateChain (AActor *actor, FState * State) // Assume success. The code pointer will set this to false if necessary StateCall.State = State; StateCall.Result = true; - if (State->CallAction(actor, &StateCall)) + if (State->CallAction(actor, this, &StateCall)) { // collect all the results. Even one successful call signifies overall success. result |= StateCall.Result; diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index ddbf3851..116b5854 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -2611,7 +2611,7 @@ FxExpression *FxMultiNameState::Resolve(FCompileContext &ctx) CHECKRESOLVED(); if (names[0] == NAME_None) { - scope = ctx.cls; + scope = NULL; } else if (names[0] == NAME_Super) { diff --git a/src/v_video.cpp b/src/v_video.cpp index 32e70866..c6710197 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -465,9 +465,11 @@ int V_GetColorFromString (const DWORD *palette, const char *cstr) c[1] = (color & 0xff00) >> 8; c[2] = (color & 0xff); } + else goto normal; } else { +normal: // Treat it as a space-delemited hexadecimal string for (i = 0; i < 3; ++i) {