Fixed health reverting to previous max_health value on map change when game is not saved first.

Merged 64-bit specfic descriptions and  filenames into resource scripts via preprocessor definition for resource scripts.
Removed separate resource files for 64-bit builds.
This commit is contained in:
Knightmare66 2020-08-17 00:41:24 -04:00
parent 3c72935e38
commit 80982e59a6
12 changed files with 76 additions and 467 deletions

View file

@ -393,8 +393,14 @@ void Drop_Jetpack (edict_t *ent, gitem_t *item)
qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
{
if (!deathmatch->value)
if (!deathmatch->value) {
other->max_health += 1;
// Knightmare- copy max health to client_persistant_t
// Fixes health reverting to prev max_health value on
// map change when game is not saved first
if (other->client)
other->client->pers.max_health = other->max_health;
}
if (other->health < other->max_health)
other->health = other->max_health;
@ -408,6 +414,11 @@ qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
{
other->max_health += 2;
// Knightmare- copy max health to client_persistant_t
// Fixes health reverting to prev max_health value on
// map change when game is not saved first
if (other->client)
other->client->pers.max_health = other->max_health;
if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
SetRespawn (ent, ent->item->quantity);

View file

@ -433,8 +433,14 @@ void Drop_Jetpack (edict_t *ent, gitem_t *item)
qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
{
if (!deathmatch->value)
if (!deathmatch->value) {
other->max_health += 1;
// Knightmare- copy max health to client_persistant_t
// Fixes health reverting to prev max_health value on
// map change when game is not saved first
if (other->client)
other->client->pers.max_health = other->max_health;
}
if (other->health < other->max_health)
other->health = other->max_health;
@ -448,6 +454,11 @@ qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
{
other->max_health += 2;
// Knightmare- copy max health to client_persistant_t
// Fixes health reverting to prev max_health value on
// map change when game is not saved first
if (other->client)
other->client->pers.max_health = other->max_health;
if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
SetRespawn (ent, ent->item->quantity);

View file

@ -15,6 +15,14 @@
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#ifdef _WIN64
#define VER_FILEDESCRIPTION_STR "Rogue + Xatrix + Lazarus integrated game DLL (64-bit)\0"
#define VER_ORIGINALFILENAME_STR "kmq2gamex64.dll\0"
#else
#define VER_FILEDESCRIPTION_STR "Rogue + Xatrix + Lazarus integrated game DLL\0"
#define VER_ORIGINALFILENAME_STR "kmq2gamex86.dll\0"
#endif
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
@ -72,12 +80,12 @@ BEGIN
BEGIN
VALUE "Comments", "Used by Pax Imperia: http://www.markshan.com/podstrn/noviprj.htm\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Rogue + Xatrix + Lazarus integrated game DLL\0"
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", "0.990\0"
VALUE "InternalName", "kmq2gamex86.dll\0"
VALUE "InternalName", VER_ORIGINALFILENAME_STR
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "kmq2gamex86.dll\0"
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "KMQuake2 Missionpacks + Lazarus DLL\0"
VALUE "ProductVersion", "0.990\0"

View file

@ -1137,38 +1137,18 @@
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_WIN64"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\missionpack_2008_x64.rc"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_WIN64"
/>
</FileConfiguration>
</File>

View file

@ -1,131 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,9,9,0
PRODUCTVERSION 0,9,9,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x29L
#else
FILEFLAGS 0x28L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Used by Pax Imperia: http://www.markshan.com/podstrn/noviprj.htm\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Rogue + Xatrix + Lazarus integrated game DLL (64-bit)\0"
VALUE "FileVersion", "0.990\0"
VALUE "InternalName", "kmq2gamex64.dll\0"
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "kmq2gamex64.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "KMQuake2 Missionpacks + Lazarus DLL\0"
VALUE "ProductVersion", "0.990\0"
VALUE "SpecialBuild", "KMQuake2 v0.20 update 8 compatible version created by Knightmare\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
BEGIN
"&", 40001, ASCII, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_STRING1 "*"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -16,6 +16,14 @@
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#ifdef _WIN64
#define VER_FILEDESCRIPTION_STR "KMQuake2 engine mod (64-bit)\0"
#define VER_ORIGINALFILENAME_STR "kmquake2_x64.exe\0"
#else
#define VER_FILEDESCRIPTION_STR "KMQuake2 engine mod\0"
#define VER_ORIGINALFILENAME_STR "kmquake2.exe\0"
#endif
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
@ -73,12 +81,12 @@ BEGIN
BEGIN
VALUE "Comments", "Licensed under the GPL. Source available at www.markshan.com/knightmare\0"
VALUE "CompanyName", " \0"
VALUE "FileDescription", "KMQuake2 engine mod\0"
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", "0, 2, 0, 8\0"
VALUE "InternalName", "kmquake2\0"
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "kmquake2.exe\0"
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "KMQuake2\0"
VALUE "ProductVersion", "0, 2, 0, 8\0"

View file

@ -1,142 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "..\..\win32\resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winresrc.h"
#include "winuser.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,2,0,8
PRODUCTVERSION 0,2,0,8
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Licensed under the GPL. Source available at www.markshan.com/knightmare\0"
VALUE "CompanyName", " \0"
VALUE "FileDescription", "KMQuake2 engine mod (64-bit)\0"
VALUE "FileVersion", "0, 2, 0, 8\0"
VALUE "InternalName", "kmquake2_x64\0"
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "kmquake2_x64.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "KMQuake2\0"
VALUE "ProductVersion", "0, 2, 0, 8\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BITMAP2 BITMAP DISCARDABLE "..\..\win32\startup2.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOGEX 0, 0, 133, 56
STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP
EXSTYLE WS_EX_TOOLWINDOW
FONT 16, "Times New Roman", 0, 0, 0x1
BEGIN
CONTROL 115,DLGC_STATIC,"Static",SS_BITMAP,0,0,133,70
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "..\..\win32\q2.ico"
IDI_ICON2 ICON DISCARDABLE "..\..\win32\q2mp1.ico"
IDI_ICON3 ICON DISCARDABLE "..\..\win32\q2mp2.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -882,11 +882,11 @@
Filter="h;hpp;hxx;hm;inl;fi;fd"
>
<File
RelativePath="..\..\renderer\anorms.h"
RelativePath="..\..\client\anorms.h"
>
</File>
<File
RelativePath="..\..\client\anorms.h"
RelativePath="..\..\renderer\anorms.h"
>
</File>
<File
@ -1019,38 +1019,18 @@
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_WIN64"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\kmq2_2008_x64.rc"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_WIN64"
/>
</FileConfiguration>
</File>

View file

@ -18,6 +18,14 @@
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#ifdef _WIN64
#define VER_FILEDESCRIPTION_STR "Lazarus Quake II mod with CTF and ACE Bot (64-bit)\0"
#define VER_ORIGINALFILENAME_STR "kmq2gamex64.dll\0"
#else
#define VER_FILEDESCRIPTION_STR "Lazarus Quake II mod with CTF and ACE Bot\0"
#define VER_ORIGINALFILENAME_STR "kmq2gamex86.dll\0"
#endif
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
@ -49,12 +57,12 @@ BEGIN
BEGIN
VALUE "Comments", "Visit our home at http://www.planetquake.com/lazarus\0"
VALUE "CompanyName", "Hyde/Ferrara\0"
VALUE "FileDescription", "Lazarus Quake II mod with CTF and ACE Bot\0"
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", "2.230\0"
VALUE "InternalName", "kmq2gamex86.dll\0"
VALUE "InternalName", VER_ORIGINALFILENAME_STR
VALUE "LegalCopyright", "Mr. Hyde and Mad Dog\0"
VALUE "LegalTrademarks", "Lazarus is a registered trademark... oops... no it ain't, but don't use it anyway or we'll come get ya.\0"
VALUE "OriginalFilename", "kmq2gamex86.dll\0"
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Lazarus Quake II mod with Threewave/3Team CTF and ACE Bot support\0"
VALUE "ProductVersion", "2.230\0"

View file

@ -886,38 +886,18 @@
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_WIN64"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\lazarus_2008_x64.rc"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_WIN64"
/>
</FileConfiguration>
</File>

View file

@ -1,115 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "..\..\game\resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
//qbism #include "ver.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,2,3,0
PRODUCTVERSION 2,2,3,0
FILEFLAGSMASK 0x2L
#ifdef _DEBUG
FILEFLAGS 0x21L
#else
FILEFLAGS 0x20L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Visit our home at http://www.planetquake.com/lazarus\0"
VALUE "CompanyName", "Hyde/Ferrara\0"
VALUE "FileDescription", "Lazarus Quake II mod with CTF and ACE Bot (64-bit)\0"
VALUE "FileVersion", "2.230\0"
VALUE "InternalName", "kmq2gamex64.dll\0"
VALUE "LegalCopyright", "Mr. Hyde and Mad Dog\0"
VALUE "LegalTrademarks", "Lazarus is a registered trademark... oops... no it ain't, but don't use it anyway or we'll come get ya.\0"
VALUE "OriginalFilename", "kmq2gamex64.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Lazarus Quake II mod with Threewave/3Team CTF and ACE Bot support\0"
VALUE "ProductVersion", "2.230\0"
VALUE "SpecialBuild", "KMQuake2 v0.20 update 8 compatible version created by Knightmare\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""ver.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -290,8 +290,14 @@ void Drop_General (edict_t *ent, gitem_t *item)
qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
{
if (!deathmatch->value)
if (!deathmatch->value) {
other->max_health += 1;
// Knightmare- copy max health to client_persistant_t
// Fixes health reverting to prev max_health value on
// map change when game is not saved first
if (other->client)
other->client->pers.max_health = other->max_health;
}
if (other->health < other->max_health)
other->health = other->max_health;
@ -305,6 +311,11 @@ qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
{
other->max_health += 2;
// Knightmare- copy max health to client_persistant_t
// Fixes health reverting to prev max_health value on
// map change when game is not saved first
if (other->client)
other->client->pers.max_health = other->max_health;
if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
SetRespawn (ent, ent->item->quantity);