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

Fix NamalskEvents and use GetNamEventManager API #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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