mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: add spawn with weapon mp option
unfortunately it does not fit in the save buffer and won't save
This commit is contained in:
1 parent
9cde121b52
commit
474a6df3d4
9 files changed
+87
-2
No files matched your search
@@ -260,6 +260,17 @@ void botSpawn(struct chrdata *chr, u8 respawning)
|
||||
chr->aibot->moveratex = 0;
|
||||
chr->aibot->moveratey = 0;
|
||||
func0f02e9a0(chr, 0);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON)
|
||||
&& g_MpSetup.weapons[0] != MPWEAPON_NONE
|
||||
&& g_MpSetup.weapons[0] != MPWEAPON_DISABLED) {
|
||||
struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]];
|
||||
botinvGiveSingleWeapon(chr, mpweapon->weaponnum);
|
||||
botactGiveAmmoByType(aibot, mpweapon->priammotype - 1, mpweapon->priammoqty / 2);
|
||||
botinvSwitchToWeapon(chr, mpweapon->weaponnum, FUNC_PRIMARY);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,16 @@ struct menuitem g_CtcOptionsMenuItems[] = {
|
||||
MPOPTION_NOAUTOAIM,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Spawn With Weapon",
|
||||
MPOPTION_SPAWNWITHWEAPON,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
|
||||
@@ -55,6 +55,16 @@ struct menuitem g_MpCombatOptionsMenuItems[] = {
|
||||
MPOPTION_NOAUTOAIM,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Spawn With Weapon",
|
||||
MPOPTION_SPAWNWITHWEAPON,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_SEPARATOR,
|
||||
0,
|
||||
|
||||
@@ -58,6 +58,16 @@ struct menuitem g_HtmOptionsMenuItems[] = {
|
||||
MPOPTION_NOAUTOAIM,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Spawn With Weapon",
|
||||
MPOPTION_SPAWNWITHWEAPON,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
|
||||
@@ -58,6 +58,16 @@ struct menuitem g_HtbOptionsMenuItems[] = {
|
||||
MPOPTION_NOAUTOAIM,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Spawn With Weapon",
|
||||
MPOPTION_SPAWNWITHWEAPON,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
|
||||
@@ -79,6 +79,16 @@ struct menuitem g_KohOptionsMenuItems[] = {
|
||||
MPOPTION_NOAUTOAIM,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Spawn With Weapon",
|
||||
MPOPTION_SPAWNWITHWEAPON,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
|
||||
@@ -56,6 +56,16 @@ struct menuitem g_PacOptionsMenuItems[] = {
|
||||
MPOPTION_NOAUTOAIM,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Spawn With Weapon",
|
||||
MPOPTION_SPAWNWITHWEAPON,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
|
||||
+15
-2
@@ -1099,8 +1099,21 @@ void playerSpawn(void)
|
||||
g_Vars.currentplayer->prop->chr->blurnumtimesdied = 0;
|
||||
}
|
||||
} else {
|
||||
bgunEquipWeapon2(HAND_LEFT, g_DefaultWeapons[HAND_LEFT]);
|
||||
bgunEquipWeapon2(HAND_RIGHT, g_DefaultWeapons[HAND_RIGHT]);
|
||||
#ifndef PLATFORM_N64
|
||||
if ((g_MpSetup.options & MPOPTION_SPAWNWITHWEAPON)
|
||||
&& g_MpSetup.weapons[0] != MPWEAPON_NONE
|
||||
&& g_MpSetup.weapons[0] != MPWEAPON_DISABLED) {
|
||||
struct mpweapon *mpweapon = &g_MpWeapons[g_MpSetup.weapons[0]];
|
||||
invGiveSingleWeapon(mpweapon->weaponnum);
|
||||
bgunEquipWeapon2(HAND_LEFT, WEAPON_NONE);
|
||||
bgunEquipWeapon2(HAND_RIGHT, mpweapon->weaponnum);
|
||||
bgunSetAmmoQuantity(mpweapon->priammotype, mpweapon->priammoqty / 2);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
bgunEquipWeapon2(HAND_LEFT, g_DefaultWeapons[HAND_LEFT]);
|
||||
bgunEquipWeapon2(HAND_RIGHT, g_DefaultWeapons[HAND_RIGHT]);
|
||||
}
|
||||
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
if (g_Vars.currentplayer->model00d4 == NULL
|
||||
|
||||
@@ -2889,6 +2889,7 @@
|
||||
#define MPOPTION_HTM_SHOWONRADAR 0x00040000
|
||||
#define MPOPTION_PAC_HIGHLIGHTTARGET 0x00080000
|
||||
#define MPOPTION_PAC_SHOWONRADAR 0x00100000
|
||||
#define MPOPTION_SPAWNWITHWEAPON 0x00200000
|
||||
|
||||
#define MPPAUSEMODE_UNPAUSED 0
|
||||
#define MPPAUSEMODE_PAUSED 1
|
||||
|
||||
Reference in new issue
Block a user