diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 46fd944ddd..a99a9204ca 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,14 @@ +June 10, 2008 (Changes by Graf Zahl) +- Added scaling to double size for idmypos display. +- Changed: Players don't telefrag when they are spawned now but after all + actors have been spawned to avoid accidental voodoo doll telefragging. +- Fixed: ACS scripts for non-existent maps were started on the current one. +- Added a 'wallbouncefactor' property to AActor. +- Reverted forceunderwater change from r1026 and fixed the problem for real: + SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. + So the initial check of the current sector in AActor::UpdateWaterLevel + must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. + June 9, 2008 - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. diff --git a/src/actor.h b/src/actor.h index d3871789d2..5f93672e36 100644 --- a/src/actor.h +++ b/src/actor.h @@ -690,6 +690,7 @@ public: // This is not the same as meleerange fixed_t maxtargetrange; // any target farther away cannot be attacked fixed_t bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70. + fixed_t wallbouncefactor; // The bounce factor for walls can be different. int bouncecount; // Strife's grenades only bounce twice before exploding fixed_t gravity; // [GRB] Gravity factor int FastChaseStrafeCount; diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index f2877636d7..ca3344c146 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -68,6 +68,7 @@ #include "c_dispatch.h" #include "p_acs.h" #include "s_sndseq.h" +#include "r_interpolate.h" // MACROS ------------------------------------------------------------------ @@ -231,6 +232,7 @@ static DObject **SweepList(DObject **p, size_t count, size_t *finalize_count) // thinker pointer is changed. This seems easier and perfectly reasonable, since // a live thinker that isn't on a thinker list isn't much of a thinker. assert(!curr->IsKindOf(RUNTIME_CLASS(DThinker)) || (curr->ObjectFlags & OF_Sentinel)); + assert(!curr->IsKindOf(RUNTIME_CLASS(DInterpolation))); curr->Destroy(); } curr->ObjectFlags |= OF_Cleanup; diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 323b3c0f47..32e38b99c4 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -746,9 +746,9 @@ static void DrawCoordinates(player_t * CPlayer) z = P_PointInSector(x, y)->floorplane.ZatPoint(x, y); } - int vwidth = con_scaletext!=2? SCREENWIDTH : SCREENWIDTH/2; - int vheight = con_scaletext!=2? SCREENHEIGHT : SCREENHEIGHT/2; - int xpos = vwidth - SmallFont->StringWidth("X:-99999"); + int vwidth = con_scaletext==0? SCREENWIDTH : SCREENWIDTH/2; + int vheight = con_scaletext==0? SCREENHEIGHT : SCREENHEIGHT/2; + int xpos = vwidth - SmallFont->StringWidth("X: -00000")-6; int ypos = 18; sprintf(coordstr, "X: %d", x>>FRACBITS); diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 92e9dcdb10..440b8d044f 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -1120,21 +1120,46 @@ void DBaseStatusBar::Draw (EHudState state) if (idmypos) { // Draw current coordinates int height = screen->Font->GetHeight(); - int y = ::ST_Y - height; char labels[3] = { 'X', 'Y', 'Z' }; fixed_t *value; int i; + int vwidth; + int vheight; + int xpos; + int y; + + if (con_scaletext == 0) + { + vwidth = SCREENWIDTH; + vheight = SCREENHEIGHT; + xpos = vwidth - 80; + y = ::ST_Y - height; + } + else + { + vwidth = SCREENWIDTH/2; + vheight = SCREENHEIGHT/2; + xpos = vwidth - SmallFont->StringWidth("X: -00000")-6; + y = ::ST_Y/2 - height; + } + if (gameinfo.gametype == GAME_Strife) { - y -= height * 4; + if (con_scaletext == 0) + y -= height * 4; + else + y -= height * 2; } value = &CPlayer->mo->z; for (i = 2, value = &CPlayer->mo->z; i >= 0; y -= height, --value, --i) { sprintf (line, "%c: %d", labels[i], *value >> FRACBITS); - screen->DrawText (CR_GREEN, SCREENWIDTH - 80, y, line, TAG_DONE); + screen->DrawText (CR_GREEN, xpos, y, line, + DTA_KeepRatio, true, + DTA_VirtualWidth, vwidth, DTA_VirtualHeight, vheight, + TAG_DONE); BorderNeedRefresh = screen->GetPageCount(); } } diff --git a/src/info.h b/src/info.h index f7be057027..e938d9d0ec 100644 --- a/src/info.h +++ b/src/info.h @@ -288,6 +288,7 @@ enum ADEF_MaxDropOffHeight, ADEF_MaxStepHeight, ADEF_BounceFactor, + ADEF_WallBounceFactor, ADEF_BounceCount, ADEF_FloatSpeed, ADEF_RDFactor, diff --git a/src/infodefaults.cpp b/src/infodefaults.cpp index a53929d7f0..4f059d1df5 100644 --- a/src/infodefaults.cpp +++ b/src/infodefaults.cpp @@ -223,6 +223,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) case ADEF_MaxDropOffHeight: actor->MaxDropOffHeight = dataint; break; case ADEF_MaxStepHeight: actor->MaxStepHeight = dataint; break; case ADEF_BounceFactor: actor->bouncefactor = dataint; break; + case ADEF_WallBounceFactor: actor->wallbouncefactor = dataint; break; case ADEF_BounceCount: actor->bouncecount = dataint; break; case ADEF_RDFactor: sgClass->Meta.SetMetaFixed (AMETA_RDFactor, dataint); break; case ADEF_FXFlags: actor->effects = dataint; break; diff --git a/src/infomacros.h b/src/infomacros.h index 10fc6761b3..18680ebbd8 100644 --- a/src/infomacros.h +++ b/src/infomacros.h @@ -265,6 +265,7 @@ public: #define PROP_MaxDropOffHeight(x) ADD_FIXD_PROP(ADEF_MaxDropOffHeight,x) #define PROP_MaxStepHeight(x) ADD_FIXD_PROP(ADEF_MaxStepHeight,x) #define PROP_BounceFactor(x) ADD_LONG_PROP(ADEF_BounceFactor,x) +#define PROP_WallBounceFactor(x) ADD_LONG_PROP(ADEF_WallBounceFactor,x) #define PROP_BounceCount(x) ADD_LONG_PROP(ADEF_BounceCount,x) #define PROP_RadiusdamageFactor(x) ADD_LONG_PROP(ADEF_RDFactor,x) #define PROP_FXFlags(x) ADD_LONG_PROP(ADEF_FXFlags,x) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 716871ec88..28d21c9ebf 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1558,10 +1558,11 @@ FUNC(LS_ACS_Execute) { level_info_t *info; - if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) ) + if (arg1 == 0) return P_StartScript (it, ln, arg0, level.mapname, backSide, arg2, arg3, arg4, false, false); - else + else if ((info = FindLevelByNum (arg1)) ) return P_StartScript (it, ln, arg0, info->mapname, backSide, arg2, arg3, arg4, false, false); + else return false; } FUNC(LS_ACS_ExecuteAlways) @@ -1569,10 +1570,11 @@ FUNC(LS_ACS_ExecuteAlways) { level_info_t *info; - if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) ) + if (arg1 == 0) return P_StartScript (it, ln, arg0, level.mapname, backSide, arg2, arg3, arg4, true, false); - else + else if ((info = FindLevelByNum (arg1)) ) return P_StartScript (it, ln, arg0, info->mapname, backSide, arg2, arg3, arg4, true, false); + else return false; } FUNC(LS_ACS_LockedExecute) @@ -1607,9 +1609,9 @@ FUNC(LS_ACS_Suspend) { level_info_t *info; - if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) ) + if (arg1 == 0) P_SuspendScript (arg0, level.mapname); - else + else if ((info = FindLevelByNum (arg1)) ) P_SuspendScript (arg0, info->mapname); return true; @@ -1620,9 +1622,9 @@ FUNC(LS_ACS_Terminate) { level_info_t *info; - if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) ) + if (arg1 == 0) P_TerminateScript (arg0, level.mapname); - else + else if ((info = FindLevelByNum (arg1)) ) P_TerminateScript (arg0, info->mapname); return true; diff --git a/src/p_map.cpp b/src/p_map.cpp index ec1f8804b6..459c7c636a 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2302,7 +2302,7 @@ bool FSlide::BounceWall (AActor *mo) deltaangle >>= ANGLETOFINESHIFT; movelen = P_AproxDistance (mo->momx, mo->momy); - movelen = (movelen * 192) >> 8; // friction + movelen = FixedMul(movelen, mo->wallbouncefactor); FBoundingBox box(mo->x, mo->y, mo->radius); if (box.BoxOnLineSide (line) == -1) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index f2976e51c8..cfef4ed7ab 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -311,6 +311,7 @@ void AActor::Serialize (FArchive &arc) << MaxDropOffHeight << MaxStepHeight << bouncefactor + << wallbouncefactor << bouncecount << maxtargetrange << meleethreshold @@ -3059,7 +3060,7 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) return false; } - if (Sector->MoreFlags & SECF_UNDERWATERMASK) + if (Sector->MoreFlags & SECF_UNDERWATER) // intentionally not SECF_UNDERWATERMASK { waterlevel = 3; } @@ -3069,7 +3070,7 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) if (hsec != NULL && !(hsec->MoreFlags & SECF_IGNOREHEIGHTSEC)) { fh = hsec->floorplane.ZatPoint (x, y); - //if (hsec->MoreFlags & SECF_UNDERWATERMASK) // also check Boom-style non-swimmable sectors! + //if (hsec->MoreFlags & SECF_UNDERWATERMASK) // also check Boom-style non-swimmable sectors { if (z < fh) { @@ -3094,13 +3095,13 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) } } // even non-swimmable deep water must be checked here to do the splashes correctly - // But the water level must be reset when this function returns! + // But the water level must be reset when this function returns if (!(hsec->MoreFlags&SECF_UNDERWATERMASK)) reset=true; } } - // some additional checks to make deep sectors � la Boom splash without setting + // some additional checks to make deep sectors like Boom's splash without setting // the water flags. if (boomwaterlevel == 0 && waterlevel != 0 && dosplash) P_HitWater(this, Sector, fh); boomwaterlevel=waterlevel; @@ -3169,7 +3170,8 @@ BEGIN_DEFAULTS (AActor, Any, -1, 0) PROP_MeleeRange(44) // MELEERANGE(64) - 20 PROP_MaxDropOffHeight(24) PROP_MaxStepHeight(24) - PROP_BounceFactor(FRACUNIT*7/10) + PROP_BounceFactor(FRACUNIT*3/4) + PROP_WallBounceFactor(FRACUNIT) PROP_BounceCount(-1) PROP_FloatSpeed(4) PROP_Gravity(FRACUNIT) @@ -3699,8 +3701,6 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) mobj->z = mobj->ceilingz - mobj->height; } - // [RH] If someone is in the way, kill them - P_PlayerStartStomp (mobj); // [BC] Do script stuff if (!tempplayer) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 3efa545690..51fffaa857 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1488,6 +1488,11 @@ void P_SpawnThings (int position) { SpawnMapThing (i, &MapThingsConverted[i], position); } + for(int i=0; iMoreFlags |= SECF_UNDERWATER; } - else if (forcewater && lines[i].sidenum[1] == NO_SIDE) + else if (forcewater) { sec->MoreFlags |= SECF_FORCEDUNDERWATER; } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 4537a76a9b..889d3d3b2d 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -1572,6 +1572,15 @@ static void ActorBounceFactor (FScanner &sc, AActor *defaults, Baggage &bag) defaults->bouncefactor = clamp(fixed_t(sc.Float * FRACUNIT), 0, FRACUNIT); } +//========================================================================== +// +//========================================================================== +static void ActorWallBounceFactor (FScanner &sc, AActor *defaults, Baggage &bag) +{ + sc.MustGetFloat (); + defaults->wallbouncefactor = clamp(fixed_t(sc.Float * FRACUNIT), 0, FRACUNIT); +} + //========================================================================== // //========================================================================== @@ -2747,6 +2756,7 @@ static const ActorProps props[] = { "tag", ActorTag, RUNTIME_CLASS(AActor) }, { "translation", ActorTranslation, RUNTIME_CLASS(AActor) }, { "vspeed", ActorVSpeed, RUNTIME_CLASS(AActor) }, + { "wallbouncefactor", ActorWallBounceFactor, RUNTIME_CLASS(AActor) }, { "weapon.ammogive", (apf)WeaponAmmoGive1, RUNTIME_CLASS(AWeapon) }, { "weapon.ammogive1", (apf)WeaponAmmoGive1, RUNTIME_CLASS(AWeapon) }, { "weapon.ammogive2", (apf)WeaponAmmoGive2, RUNTIME_CLASS(AWeapon) }, diff --git a/src/version.h b/src/version.h index 661f89322d..13661243b6 100644 --- a/src/version.h +++ b/src/version.h @@ -75,7 +75,7 @@ // SAVESIG should match SAVEVER. // MINSAVEVER is the minimum level snapshot version that can be loaded. -#define MINSAVEVER 1018 +#define MINSAVEVER 1027 #if SVN_REVISION_NUMBER < MINSAVEVER // Never write a savegame with a version lower than what we need