SVN r148 (trunk)

This commit is contained in:
Christoph Oelckers 2006-05-27 10:27:51 +00:00
parent 67da924a02
commit 96f6cfd18a
7 changed files with 32 additions and 15 deletions

View file

@ -1,3 +1,10 @@
May 27, 2006 (Changes by Graf Zahl)
- Fixed: FString::FormatHelper must not alter the null string.
- Fixed: FString::FormatHelper should use ReallocBuffer instead of directly
calling Realloc. This caused crashes with the ACS print function.
- Fixed: The dummy player spawned in G_FinishTravel must not start any ENTER
scripts.
May 26, 2006 May 26, 2006
- Changed makewad's zip routines so that it simply stores files that cannot be - Changed makewad's zip routines so that it simply stores files that cannot be
compressed smaller instead of using deflate anyway. Saves 133 bytes currently. compressed smaller instead of using deflate anyway. Saves 133 bytes currently.

View file

@ -2004,7 +2004,11 @@ void G_FinishTravel ()
else else
{ {
oldpawn = pawndup; oldpawn = pawndup;
P_SpawnPlayer (&playerstarts[pawn->player - players]);
// The player being spawned here is a short lived dummy and
// must not start any ENTER script or big problems will happen.
P_SpawnPlayer (&playerstarts[pawn->player - players], false);
pawndup = pawn->player->mo; pawndup = pawn->player->mo;
if (!startkeepfacing) if (!startkeepfacing)
{ {

View file

@ -90,7 +90,7 @@ void P_UnPredictPlayer ();
extern fixed_t FloatBobOffsets[64]; extern fixed_t FloatBobOffsets[64];
extern AActor *MissileActor; extern AActor *MissileActor;
void P_SpawnPlayer (mapthing2_t* mthing); void P_SpawnPlayer (mapthing2_t* mthing, bool startenterscripts = true);
void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move); void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move);
int P_FaceMobj (AActor *source, AActor *target, angle_t *delta); int P_FaceMobj (AActor *source, AActor *target, angle_t *delta);

View file

@ -3292,7 +3292,7 @@ void AActor::AdjustFloorClip ()
EXTERN_CVAR (Bool, chasedemo) EXTERN_CVAR (Bool, chasedemo)
extern bool demonew; extern bool demonew;
void P_SpawnPlayer (mapthing2_t *mthing) void P_SpawnPlayer (mapthing2_t *mthing, bool startenterscripts)
{ {
int playernum; int playernum;
player_t *p; player_t *p;
@ -3428,7 +3428,12 @@ void P_SpawnPlayer (mapthing2_t *mthing)
p->cheats = CF_CHASECAM; p->cheats = CF_CHASECAM;
// setup gun psprite // setup gun psprite
P_SetupPsprites (p); if (startenterscripts)
{
// This can also start a script so don't do it for
// the dummy player.
P_SetupPsprites (p);
}
// give all cards in death match mode // give all cards in death match mode
if (deathmatch) if (deathmatch)
@ -3472,13 +3477,16 @@ void P_SpawnPlayer (mapthing2_t *mthing)
P_PlayerStartStomp (mobj); P_PlayerStartStomp (mobj);
// [BC] Do script stuff // [BC] Do script stuff
if (state == PST_ENTER || (state == PST_LIVE && !savegamerestore)) if (startenterscripts)
{ {
FBehavior::StaticStartTypedScripts (SCRIPT_Enter, p->mo, true); if (state == PST_ENTER || (state == PST_LIVE && !savegamerestore))
} {
else if (state == PST_REBORN) FBehavior::StaticStartTypedScripts (SCRIPT_Enter, p->mo, true);
{ }
FBehavior::StaticStartTypedScripts (SCRIPT_Respawn, p->mo, true); else if (state == PST_REBORN)
{
FBehavior::StaticStartTypedScripts (SCRIPT_Respawn, p->mo, true);
}
} }
} }

View file

@ -46,8 +46,6 @@
#include "v_palette.h" #include "v_palette.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
extern void P_SpawnPlayer (mapthing2_t *mthing);
static void CopyPlayer (player_t *dst, player_t *src, const char *name); static void CopyPlayer (player_t *dst, player_t *src, const char *name);
static void ReadOnePlayer (FArchive &arc); static void ReadOnePlayer (FArchive &arc);
static void ReadMultiplePlayers (FArchive &arc, int numPlayers, int numPlayersNow); static void ReadMultiplePlayers (FArchive &arc, int numPlayers, int numPlayersNow);

View file

@ -218,9 +218,9 @@ int FString::FormatHelper (void *data, const char *cstr, int len)
{ {
FString *str = (FString *)data; FString *str = (FString *)data;
size_t len1 = str->Len(); size_t len1 = str->Len();
if (len1 + len > str->Data()->AllocLen) if (len1 + len > str->Data()->AllocLen || str->Chars == &NullString.Nothing[0])
{ {
str->Chars = (char *)(str->Data()->Realloc((len1 + len + 127) & ~127) + 1); str->ReallocBuffer((len1 + len + 127) & ~127);
} }
StrCopy (str->Chars + len1, cstr, len); StrCopy (str->Chars + len1, cstr, len);
str->Data()->Len = (unsigned int)(len1 + len); str->Data()->Len = (unsigned int)(len1 + len);

View file

@ -1,4 +1,4 @@
/* Generated by re2c 0.10.3 on Wed May 24 23:26:39 2006 */ /* Generated by re2c 0.10.3 on Sat May 27 10:44:26 2006 */
#line 1 "scanner.re" #line 1 "scanner.re"
#include <string.h> #include <string.h>
#include <malloc.h> #include <malloc.h>