Skip to content
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

Prevent weaponhide/kill/input disable on blowout end if godmode is on #1404

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/xrGame/level_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,13 @@ void show_indicators()
psActorFlags.set(AF_GODMODE_RT, FALSE);
}

void show_weapon(bool b) { psHUD_Flags.set(HUD_WEAPON_RT2, b); }
void show_weapon(bool b)
{
if (psActorFlags.test(AF_GODMODE) && Actor())
return;

psHUD_Flags.set(HUD_WEAPON_RT2, b);
}
bool is_level_present() { return (!!g_pGameLevel); }
void add_call(const luabind::functor<bool>& condition, const luabind::functor<void>& action)
{
Expand Down Expand Up @@ -349,6 +355,9 @@ CEnvDescriptor* current_environment(CEnvironment* self) { return &self->CurrentE
extern bool g_bDisableAllInput;
void disable_input()
{
if (psActorFlags.test(AF_GODMODE) && Actor())
return;

g_bDisableAllInput = true;
#ifdef DEBUG
Msg("input disabled");
Expand Down
3 changes: 3 additions & 0 deletions src/xrGame/script_game_object_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ LPCSTR CScriptGameObject::Section() const { return (*object().cNameSect()); }
void CScriptGameObject::Kill(CScriptGameObject* who, bool bypass_actor_check /*AVO: added for actor before death callback*/)
{
CEntity* l_tpEntity = smart_cast<CEntity*>(&object());
if (psActorFlags.test(AF_GODMODE) && !!l_tpEntity->cast_actor())
return;

if (!l_tpEntity)
{
GEnv.ScriptEngine->script_log(
Expand Down