diff --git a/src/info.cpp b/src/info.cpp index 4487d7ac7..2773501b0 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -59,12 +59,11 @@ extern void LoadDecorations (); int GetSpriteIndex(const char * spritename) { // Make sure that the string is upper case and 4 characters long - char upper[5]; + char upper[5]={0,0,0,0,0}; for (int i = 0; spritename[i] != 0 && i < 4; i++) { upper[i] = toupper (spritename[i]); } - upper[4] = 0; for (unsigned i = 0; i < sprites.Size (); ++i) { diff --git a/src/p_states.cpp b/src/p_states.cpp index 0bda6dca3..03762888b 100644 --- a/src/p_states.cpp +++ b/src/p_states.cpp @@ -540,6 +540,7 @@ void FStateDefinitions::MakeStateList(const FStateLabels *list, TArrayLabels[i].Label; def.State = list->Labels[i].State; + def.DefineFlags = SDF_STATE; dest.Push(def); if (list->Labels[i].Children != NULL) { @@ -721,10 +722,11 @@ void FStateDefinitions::FixStatePointers (FActorInfo *actor, TArray= 1 && v < 0x10000) + if (list[i].DefineFlags == SDF_INDEX) { + size_t v=(size_t)list[i].State; list[i].State = actor->OwnedStates + v - 1; + list[i].DefineFlags = SDF_STATE; } if (list[i].Children.Size() > 0) FixStatePointers(actor, list[i].Children); } @@ -764,6 +766,8 @@ int FStateDefinitions::FinishStates (FActorInfo *actor, AActor *defaults, TArray static int c=0; int count = StateArray.Size(); + DPrintf("Finishing states for %s\n", actor->Class->TypeName.GetChars()); + if (count > 0) { FState *realstates = new FState[count]; diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index f06b8d80c..557bee5c7 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -311,6 +311,7 @@ bool ParsePropertyParams(FScanner &sc, FPropertyInfo *prop, AActor *defaults, Ba nocomma = false; conv.s = NULL; + pref.s = NULL; pref.i = -1; switch ((*p) & 223) {