From 0441994106f5224f9048870de47ddd65c2cb9999 Mon Sep 17 00:00:00 2001 From: ZippeyKeys12 Date: Fri, 30 Mar 2018 18:06:46 -0500 Subject: [PATCH 1/7] Default newradius in A_SetSize --- src/p_actionfunctions.cpp | 2 +- wadsrc/static/zscript/actor.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 1a3333bdd5..0cb4e98493 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -6765,7 +6765,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain) DEFINE_ACTION_FUNCTION(AActor, A_SetSize) { PARAM_SELF_PROLOGUE(AActor); - PARAM_FLOAT(newradius); + PARAM_FLOAT_DEF(newradius); PARAM_FLOAT_DEF(newheight); PARAM_BOOL_DEF(testpos); diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index a7f76f348f..bec97eda33 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -1145,7 +1145,7 @@ class Actor : Thinker native native bool A_CopySpriteFrame(int from, int to, int flags = 0); native bool A_SetVisibleRotation(double anglestart = 0, double angleend = 0, double pitchstart = 0, double pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT); native void A_SetTranslation(name transname); - native bool A_SetSize(double newradius, double newheight = -1, bool testpos = false); + native bool A_SetSize(double newradius = -1, double newheight = -1, bool testpos = false); native void A_SprayDecal(String name, double dist = 172); native void A_SetMugshotState(String name); From 17bc9c3f69669713ca256c45d5a373d707cc5b3c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 31 Mar 2018 11:46:06 +0300 Subject: [PATCH 2/7] Fixed handling of default value in Actor.Vec3Angle() --- src/p_mobj.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e27ab198c0..21126f645b 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -8317,15 +8317,15 @@ DEFINE_ACTION_FUNCTION(AActor, Vec2To) { PARAM_SELF_PROLOGUE(AActor); PARAM_OBJECT_NOT_NULL(t, AActor) - ACTION_RETURN_VEC2(self->Vec2To(t)); + ACTION_RETURN_VEC2(self->Vec2To(t)); } DEFINE_ACTION_FUNCTION(AActor, Vec3Angle) { PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(length) - PARAM_ANGLE(angle); - PARAM_FLOAT(z); + PARAM_ANGLE(angle); + PARAM_FLOAT_DEF(z); PARAM_BOOL_DEF(absolute); ACTION_RETURN_VEC3(self->Vec3Angle(length, angle, z, absolute)); } From ca0e39cd0ce7ca1ca76994d35832e48749dfad74 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 31 Mar 2018 15:20:00 +0300 Subject: [PATCH 3/7] Added ability to load any IWAD without extension Previously, only .wad files can specified without file extension for -iwad command line option For example, -iwad square1 will load square1.pk3 as IWAD --- src/d_iwad.cpp | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 29c3ea98b8..5aa5f35b8b 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -519,28 +519,39 @@ int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, if (iwadparm) { - // Check if the given IWAD has an absolute path, in which case the search path will be ignored. - custwad = iwadparm; - FixPathSeperator(custwad); - DefaultExtension(custwad, ".wad"); - bool isAbsolute = (custwad[0] == '/'); + const char* const extensions[] = { ".wad", ".pk3", ".iwad", ".ipk3", ".ipk7" }; + + for (auto ext : extensions) + { + // Check if the given IWAD has an absolute path, in which case the search path will be ignored. + custwad = iwadparm; + FixPathSeperator(custwad); + DefaultExtension(custwad, ext); + bool isAbsolute = (custwad[0] == '/'); #ifdef WINDOWS - isAbsolute |= (custwad.Len() >= 2 && custwad[1] == ':'); + isAbsolute |= (custwad.Len() >= 2 && custwad[1] == ':'); #endif - if (isAbsolute) - { - if (FileExists(custwad)) mFoundWads.Push({ custwad, "", -1 }); - } - else - { - for (auto &dir : mSearchPaths) + if (isAbsolute) { - FStringf fullpath("%s/%s", dir.GetChars(), custwad.GetChars()); - if (FileExists(fullpath)) + if (FileExists(custwad)) mFoundWads.Push({ custwad, "", -1 }); + } + else + { + for (auto &dir : mSearchPaths) { - mFoundWads.Push({ fullpath, "", -1 }); + FStringf fullpath("%s/%s", dir.GetChars(), custwad.GetChars()); + if (FileExists(fullpath)) + { + mFoundWads.Push({ fullpath, "", -1 }); + } } } + + if (mFoundWads.Size() != numFoundWads) + { + // Found IWAD with guessed extension + break; + } } } // -iwad not found or not specified. Revert back to standard behavior. From b36fc82fff16f38c7bb03f8ddbe58da34a82d020 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 31 Mar 2018 15:25:25 +0300 Subject: [PATCH 4/7] Removed check for duplicate IWADs Skipping of duplicate IWADs seems to serve a cosmetic purpose only but it caused troubles with custom IWADs https://forum.zdoom.org/viewtopic.php?t=58333 --- src/d_iwad.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 5aa5f35b8b..d263ba0734 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -348,13 +348,6 @@ int FIWadManager::CheckIWADInfo(const char *fn) FIWADInfo result; ParseIWadInfo(resfile->Filename, (const char*)lmp->CacheLump(), lmp->LumpSize, &result); delete resfile; - for (auto &wadinf : mIWadInfos) - { - if (wadinf.Name == result.Name) - { - return -1; // do not show the same one twice. - } - } return mIWadInfos.Push(result); } catch (CRecoverableError &err) From 4afc538f885612f72841f9802fbbd2d17929d674 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 31 Mar 2018 18:14:27 +0200 Subject: [PATCH 5/7] =?UTF-8?q?Localize=20the=20word=20=E2=80=9Cfor?= =?UTF-8?q?=E2=80=9D=20in=20Strife=E2=80=99s=20trading=20dialogs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This deals with what seems to be the only hardcoded piece of text in Strife. Also added a translation to the French file and removed a few superfluous line breaks in the English one. --- wadsrc/static/language.enu | 7 +------ wadsrc/static/language.fr | 2 ++ wadsrc/static/zscript/menu/conversationmenu.txt | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index da16d83e44..d7da664e1d 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -579,7 +579,6 @@ NERVETEXT = "\n" "THIS RIDE IS CLOSED.\n"; - // Cast list (must appear in this order) CC_ZOMBIE = "ZOMBIEMAN"; CC_SHOTGUN = "SHOTGUN GUY"; @@ -1299,7 +1298,6 @@ TXT_IMITEMS = "ITEMS"; TXT_IMSECRETS = "SECRETS"; TXT_IMTIME = "TIME"; - RAVENQUITMSG = "ARE YOU SURE YOU WANT TO QUIT?"; // Hexen strings @@ -1459,7 +1457,6 @@ TXT_MAULER = "You picked up the mauler."; TXT_GLAUNCHER = "You picked up the Grenade launcher."; TXT_SIGIL = "You picked up the SIGIL."; - TXT_BASEKEY = "You picked up the Base Key."; TXT_GOVSKEY = "You picked up the Govs Key."; TXT_PASSCARD = "You picked up the Passcard."; @@ -1567,6 +1564,7 @@ TXT_GOAWAY = "Go away!"; TXT_COMM0 = "Incoming Message"; TXT_COMM1 = "Incoming Message from BlackBird"; +TXT_TRADE = " for %u"; AMMO_CLIP = "Bullets"; AMMO_SHELLS = "Shotgun Shells"; @@ -2471,12 +2469,10 @@ OPTSTR_NOINTERPOLATION = "No interpolation"; OPTSTR_SPLINE = "Spline"; OPTSTR_OPENAL = "OpenAL"; - NOTSET = "Not set"; SAFEMESSAGE = "Do you really want to do this?"; MNU_COLORPICKER = "SELECT COLOR"; - WI_FINISHED = "finished"; WI_ENTERING = "Now entering:"; @@ -2852,7 +2848,6 @@ DSPLYMNU_TCOPT = "TrueColor Options"; TCMNU_TITLE = "TRUECOLOR OPTIONS"; - TCMNU_TRUECOLOR = "True color output"; TCMNU_MINFILTER = "Linear filter when downscaling"; TCMNU_MAGFILTER = "Linear filter when upscaling"; diff --git a/wadsrc/static/language.fr b/wadsrc/static/language.fr index 9731033278..fa49cc07eb 100644 --- a/wadsrc/static/language.fr +++ b/wadsrc/static/language.fr @@ -1646,6 +1646,8 @@ TXT_GOAWAY = "Allez-vous en!"; TXT_COMM0 = "Message reçu."; TXT_COMM1 = "Message reçu de BlackBird"; +TXT_TRADE = " pour %u"; + AMMO_CLIP = "Balles"; AMMO_SHELLS = "Cartouches"; AMMO_ROCKETS = "Roquettes"; diff --git a/wadsrc/static/zscript/menu/conversationmenu.txt b/wadsrc/static/zscript/menu/conversationmenu.txt index 8d05ee4baa..3474753e8f 100644 --- a/wadsrc/static/zscript/menu/conversationmenu.txt +++ b/wadsrc/static/zscript/menu/conversationmenu.txt @@ -137,7 +137,7 @@ class ConversationMenu : Menu mShowGold |= reply.NeedsGold; let ReplyText = Stringtable.Localize(reply.Reply); - if (reply.NeedsGold) ReplyText.AppendFormat(" for %u", reply.PrintAmount); + if (reply.NeedsGold) ReplyText.AppendFormat(Stringtable.Localize("$TXT_TRADE"), reply.PrintAmount); let ReplyLines = SmallFont.BreakLines (ReplyText, ReplyWidth); From ff96980dda3719e81398bbc5f2e8073c14abb61e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 31 Mar 2018 21:45:20 +0300 Subject: [PATCH 6/7] Fixed handling of default values in String.Mid() https://forum.zdoom.org/viewtopic.php?t=60047 --- src/scripting/thingdef_data.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 09e28ba556..4560b282ef 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -1204,8 +1204,8 @@ DEFINE_ACTION_FUNCTION(FStringStruct, AppendFormat) DEFINE_ACTION_FUNCTION(FStringStruct, Mid) { PARAM_SELF_STRUCT_PROLOGUE(FString); - PARAM_UINT(pos); - PARAM_UINT(len); + PARAM_UINT_DEF(pos); + PARAM_UINT_DEF(len); FString s = self->Mid(pos, len); ACTION_RETURN_STRING(s); } From 23146c9b18be9af29380478b6ebf05090b36f4cd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 1 Apr 2018 08:37:32 +0200 Subject: [PATCH 7/7] - made all elements of DehInfo and State read-only. This data must be immutable, if any mod plays loose here, very bad things can happen, so this hole got plugged, even at the expense risking to break some badly behaving mods. --- wadsrc/static/zscript/base.txt | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index acaa831b56..52020816de 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -663,31 +663,31 @@ struct StringTable native // Most are handled at load time and are omitted here. struct DehInfo native { - native int MaxSoulsphere; - native uint8 ExplosionStyle; - native double ExplosionAlpha; - native int NoAutofreeze; - native int BFGCells; - native int BlueAC; + native readonly int MaxSoulsphere; + native readonly uint8 ExplosionStyle; + native readonly double ExplosionAlpha; + native readonly int NoAutofreeze; + native readonly int BFGCells; + native readonly int BlueAC; } struct State native { - native State NextState; - native int sprite; - native int16 Tics; - native uint16 TicRange; - native uint8 Frame; - native uint8 UseFlags; - native int Misc1; - native int Misc2; - native uint16 bSlow; - native uint16 bFast; - native bool bFullbright; - native bool bNoDelay; - native bool bSameFrame; - native bool bCanRaise; - native bool bDehacked; + native readonly State NextState; + native readonly int sprite; + native readonly int16 Tics; + native readonly uint16 TicRange; + native readonly uint8 Frame; + native readonly uint8 UseFlags; + native readonly int Misc1; + native readonly int Misc2; + native readonly uint16 bSlow; + native readonly uint16 bFast; + native readonly bool bFullbright; + native readonly bool bNoDelay; + native readonly bool bSameFrame; + native readonly bool bCanRaise; + native readonly bool bDehacked; native int DistanceTo(state other); native bool ValidateSpriteFrame();