diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index e53a1d3629..6b430fa038 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -367,7 +367,7 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads) // Under UNIX OSes, the search path is: // 1. Current directory // 2. $DOOMWADDIR -// 3. $HOME/.zdoom +// 3. $HOME/.config/zdoom // 4. The share directory defined at compile time (/usr/local/share/zdoom) // // The search path can be altered by editing the IWADSearch.Directories @@ -516,9 +516,19 @@ int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, I_FatalError ("Cannot find a game IWAD (doom.wad, doom2.wad, heretic.wad, etc.).\n" "Did you install ZDoom properly? You can do either of the following:\n" "\n" +#if defined(_WIN32) "1. Place one or more of these wads in the same directory as ZDoom.\n" "2. Edit your zdoom-username.ini and add the directories of your iwads\n" "to the list beneath [IWADSearch.Directories]"); +#elif defined(__APPLE__) + "1. Place one or more of these wads in ~/Library/Application Support/zdoom/\n" + "2. Edit your ~/Library/Preferences/zdoom.ini and add the directories\n" + "of your iwads to the list beneath [IWADSearch.Directories]"); +#else + "1. Place one or more of these wads in ~/.config/zdoom/.\n" + "2. Edit your ~/.config/zdoom/zdoom.ini and add the directories of your\n" + "iwads to the list beneath [IWADSearch.Directories]"); +#endif } pickwad = 0; diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 92c8abc3ee..6832a047e1 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -1048,3 +1048,14 @@ CCMD (playerinfo) } } } + +userinfo_t::~userinfo_t() +{ + TMapIterator it(*this); + TMap::Pair *pair; + + while (it.NextPair(pair)) + { + delete pair->Value; + } +} diff --git a/src/d_player.h b/src/d_player.h index 6169dcebfd..fcc5415516 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -260,6 +260,8 @@ enum struct userinfo_t : TMap { + ~userinfo_t(); + int GetAimDist() const { if (dmflags2 & DF2_NOAUTOAIM) diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 99ac599380..20779a221b 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -898,7 +898,7 @@ IMPLEMENT_CLASS(DSaveMenu) DSaveMenu::DSaveMenu(DMenu *parent, FListMenuDescriptor *desc) : DLoadSaveMenu(parent, desc) { - strcpy (NewSaveNode.Title, ""); + strcpy (NewSaveNode.Title, GStrings["NEWSAVE"]); NewSaveNode.bNoDelete = true; SaveGames.Insert(0, &NewSaveNode); TopItem = 0; diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index a045c50989..d33f21f6f2 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -256,11 +256,20 @@ static void CopyPlayer (player_t *dst, player_t *src, const char *name) { // The userinfo needs to be saved for real players, but it // needs to come from the save for bots. - userinfo_t uibackup = dst->userinfo; + userinfo_t uibackup; + userinfo_t uibackup2; + + uibackup.TransferFrom(dst->userinfo); + uibackup2.TransferFrom(src->userinfo); + int chasecam = dst->cheats & CF_CHASECAM; // Remember the chasecam setting bool attackdown = dst->attackdown; bool usedown = dst->usedown; - *dst = *src; + + + dst->~player_t(); // ensure that the userinfo in dst does not contain anything before copying everything over. + *dst = *src; // To avoid memory leaks at this point the userinfo in src must be empty which is taken care of by the TransferFrom call above. + dst->cheats |= chasecam; if (dst->isbot) @@ -276,10 +285,11 @@ static void CopyPlayer (player_t *dst, player_t *src, const char *name) } bglobal.botnum++; bglobal.botingame[dst - players] = true; + dst->userinfo.TransferFrom(uibackup2); } else { - dst->userinfo = uibackup; + dst->userinfo.TransferFrom(uibackup); } // Validate the skin dst->userinfo.SkinNumChanged(R_FindSkin(skins[dst->userinfo.GetSkin()].name, dst->CurrentPlayerClass)); diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 3a63577484..63f7c1c89e 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -639,12 +639,21 @@ void P_SectorDamage(int tag, int amount, FName type, const PClass *protectClass, { next = actor->snext; // Only affect actors touching the 3D floor - if (actor->z + actor->height > sec->floorplane.ZatPoint(actor->x, actor->y)) + fixed_t z1 = sec->floorplane.ZatPoint(actor->x, actor->y); + fixed_t z2 = sec->ceilingplane.ZatPoint(actor->x, actor->y); + if (z2 < z1) + { + // Account for Vavoom-style 3D floors + fixed_t zz = z1; + z1 = z2; + z2 = zz; + } + if (actor->z + actor->height > z1) { // If DAMAGE_IN_AIR is used, anything not beneath the 3D floor will be // damaged (so, anything touching it or above it). Other 3D floors between // the actor and this one will not stop this effect. - if ((flags & DAMAGE_IN_AIR) || actor->z <= sec->ceilingplane.ZatPoint(actor->x, actor->y)) + if ((flags & DAMAGE_IN_AIR) || actor->z <= z2) { // Here we pass the DAMAGE_IN_AIR flag to disable the floor check, since it // only works with the real sector's floor. We did the appropriate height checks diff --git a/src/p_user.cpp b/src/p_user.cpp index 5ac8a1a885..35ab99036b 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -309,7 +309,6 @@ player_t::player_t() ConversationFaceTalker(0) { memset (&cmd, 0, sizeof(cmd)); - memset (&userinfo, 0, sizeof(userinfo)); memset (frags, 0, sizeof(frags)); memset (psprites, 0, sizeof(psprites)); memset (&skill, 0, sizeof(skill)); diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 8bf5444552..986d992033 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -174,7 +174,15 @@ void R_InitPlanes () void R_DeinitPlanes () { fakeActive = 0; - R_ClearPlanes(false); + + // do not use R_ClearPlanes because at this point the screen pointer is no longer valid. + for (int i = 0; i <= MAXVISPLANES; i++) // new code -- killough + { + for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; ) + { + freehead = &(*freehead)->next; + } + } for (visplane_t *pl = freetail; pl != NULL; ) { visplane_t *next = pl->next; @@ -490,7 +498,7 @@ void R_MapColoredPlane (int y, int x1) void R_ClearPlanes (bool fullclear) { - int i, max; + int i; // Don't clear fake planes if not doing a full clear. if (!fullclear) @@ -516,7 +524,6 @@ void R_ClearPlanes (bool fullclear) } else { - max = fullclear ? MAXVISPLANES : MAXVISPLANES-1; for (i = 0; i <= MAXVISPLANES; i++) // new code -- killough { for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; ) @@ -524,10 +531,7 @@ void R_ClearPlanes (bool fullclear) freehead = &(*freehead)->next; } } - } - if (fullclear) - { // opening / clipping determination clearbufshort (floorclip, viewwidth, viewheight); // [RH] clip ceiling to console bottom diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index d35572121a..7b571b0c52 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -70,6 +70,7 @@ #include "m_bbox.h" #include "r_data/r_translate.h" #include "p_trace.h" +#include "gstrings.h" static FRandom pr_camissile ("CustomActorfire"); @@ -2133,6 +2134,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Print) ACTION_PARAM_FLOAT(time, 1); ACTION_PARAM_NAME(fontname, 2); + if (text[0] == '$') text = GStrings(text+1); if (self->CheckLocalView (consoleplayer) || (self->target!=NULL && self->target->CheckLocalView (consoleplayer))) { @@ -2171,6 +2173,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PrintBold) float saved = con_midtime; FFont *font = NULL; + if (text[0] == '$') text = GStrings(text+1); if (fontname != NAME_None) { font = V_GetFont(fontname); @@ -2196,11 +2199,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log) { ACTION_PARAM_START(1); ACTION_PARAM_STRING(text, 0); + + if (text[0] == '$') text = GStrings(text+1); Printf("%s\n", text); ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! } -//=========================================================================== +//========================================================================= // // A_LogInt // diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 795b9348ad..4b75dfaba3 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -361,3 +361,18 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 // still set when returning to the origin map. linkfrozenprops } + +D62DCA9EC226DE49108D5DD9271F7631 // Cheogsh 2 map04 +{ + // Stuff in megasphere cage is positioned too low + setthingz 1640 528 + setthingz 1641 528 + setthingz 1642 528 + setthingz 1643 528 + setthingz 1644 528 + setthingz 1645 528 + setthingz 1646 528 + setthingz 1647 528 + setthingz 1648 528 + setthingz 1649 528 +} \ No newline at end of file diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 0c8fff5d3e..4b5225f547 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -112,6 +112,7 @@ PD_YELLOWCO = "You need a yellow card to activate this object"; PD_BLUESO = "You need a blue skull to activate this object"; PD_REDSO = "You need a red skull to activate this object"; PD_YELLOWSO = "You need a yellow skull to activate this object"; +NEWSAVE = ""; GGSAVED = "game saved."; HUSTR_MSGU = "[Message unsent]"; PICKUP_PISTOL_DROPPED = "Picked up a pistol.";