Skip to content

Commit

Permalink
Fix NamalskEvents and use GetNamEventManager API
Browse files Browse the repository at this point in the history
  • Loading branch information
S-S-X committed Oct 1, 2023
1 parent 02bbfa3 commit 6b2bef2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ChatCommandManager : PluginBase
AddChatCommand(new ReturnPlayerChatModule("/return",1,"Chat:ReturnPlayer", true));
AddChatCommand(new GotoPlayerChatModule("/goto", 1, "Chat:GotoPlayer", true));

if (VPPAT_IsModLoadded("NamalskSurvival"))
if (VPPAT_IsModLoadded("Namalsk_Survival"))
{
AddChatCommand(new NamalskEvents("/runevent", 1, "Chat:NamalskRunEvent"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ class NamalskEvents extends ChatCommand
override void ExecuteCommand(PlayerBase caller, array<Man> targets, array<string> args)
{
if(caller == null) return;

Mission ms = GetGame().GetMission();
Class eventManager;
EnScript.GetClassVar(ms, "m_EventManagerServer", 0, eventManager);

string eventTypeStr = args[0];
typename eventType = eventTypeStr.ToType();
if (eventType && eventType.IsInherited(String("NamEventBase").ToType()))
{
Class eventManager;
GetGame().GameScript.CallFunction(GetGame().GetMission(), "GetNamEventManager", eventManager, null);

bool isRunning;
GetGame().GameScript.CallFunction(eventManager, "IsEventActive", isRunning, eventType);
if (isRunning)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MenuCommandsConsole: AdminHudSubMenu
m_CmdTooltips.Insert("/kill", new Param2<string,string>("#VSTR_TOOLTIP_KILL", "<PlayerName> OR self"));
m_CmdTooltips.Insert("/strip", new Param2<string,string>("#VSTR_TOOLTIP_STRIP", "<PlayerName> OR self"));
m_CmdTooltips.Insert("/clear", new Param2<string,string>("#VSTR_TOOLTIP_CLEAR", ""));
if (VPPAT_IsModLoadded("NamalskSurvival")){
if (VPPAT_IsModLoadded("Namalsk_Survival")){
m_CmdTooltips.Insert("/runevent", new Param2<string,string>("Force start a Namalsk global event, types of events from init.c", "/runevent EVRStorm"));
}
}
Expand Down

0 comments on commit 6b2bef2

Please sign in to comment.