- 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.

SVN r1027 (trunk)
This commit is contained in:
Christoph Oelckers 2008-06-10 09:16:01 +00:00
parent 2ca601eed1
commit 4e7a6c54ef
15 changed files with 83 additions and 24 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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();
}
}

View file

@ -288,6 +288,7 @@ enum
ADEF_MaxDropOffHeight,
ADEF_MaxStepHeight,
ADEF_BounceFactor,
ADEF_WallBounceFactor,
ADEF_BounceCount,
ADEF_FloatSpeed,
ADEF_RDFactor,

View file

@ -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;

View file

@ -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)

View file

@ -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;

View file

@ -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)

View file

@ -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 <EFBFBD> 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)

View file

@ -1488,6 +1488,11 @@ void P_SpawnThings (int position)
{
SpawnMapThing (i, &MapThingsConverted[i], position);
}
for(int i=0; i<MAXPLAYERS; i++)
{
if (playeringame[i])
P_PlayerStartStomp(players[i].mo);
}
}

View file

@ -985,7 +985,7 @@ void P_SpawnSpecials (void)
{
sec->MoreFlags |= SECF_UNDERWATER;
}
else if (forcewater && lines[i].sidenum[1] == NO_SIDE)
else if (forcewater)
{
sec->MoreFlags |= SECF_FORCEDUNDERWATER;
}

View file

@ -1572,6 +1572,15 @@ static void ActorBounceFactor (FScanner &sc, AActor *defaults, Baggage &bag)
defaults->bouncefactor = clamp<fixed_t>(fixed_t(sc.Float * FRACUNIT), 0, FRACUNIT);
}
//==========================================================================
//
//==========================================================================
static void ActorWallBounceFactor (FScanner &sc, AActor *defaults, Baggage &bag)
{
sc.MustGetFloat ();
defaults->wallbouncefactor = clamp<fixed_t>(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) },

View file

@ -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