-
Notifications
You must be signed in to change notification settings - Fork 77
Weapon start fix #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Weapon start fix #563
Changes from 11 commits
6683eb5
85b2194
d3ed1cb
8241d5f
1babf91
f7a999c
923de14
03c8cd3
a33993c
e68eee7
051633e
7c253cd
49e0098
172e33f
64d78f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ namespace TFE_DarkForces | |
public: | ||
bool scriptRegister(ScriptAPI api) override; | ||
}; | ||
bool hasWeapon(s32 weapon); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
// Internal types need to be included in this case. | ||
#include <TFE_Jedi/InfSystem/infTypesInternal.h> | ||
#include <TFE_Jedi/Renderer/jediRenderer.h> | ||
#include <TFE_DarkForces/Scripting/gs_player.h> | ||
|
||
|
||
// TFE | ||
#include <TFE_System/tfeMessage.h> | ||
|
@@ -808,6 +809,19 @@ namespace TFE_DarkForces | |
disableNightVision(); | ||
hud_clearMessage(); | ||
} | ||
|
||
// Don't start the game with a weapon you don't have after overrides. | ||
if (!hasWeapon(s_playerInfo.curWeapon)) | ||
{ | ||
if (s_playerInfo.itemPistol) | ||
{ | ||
s_playerInfo.curWeapon = WPN_PISTOL; | ||
} | ||
else | ||
{ | ||
s_playerInfo.curWeapon = WPN_FIST; | ||
} | ||
} | ||
} | ||
|
||
void player_createController(JBool clearData) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now be reverted too, it doesn't have to be exposed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is complete @jerethk