t4 refactor

This commit is contained in:
ineed bots
2025-05-22 18:51:26 -06:00
parent 3e08ac900d
commit b8597ee810
4 changed files with 56 additions and 5 deletions

View File

@@ -170,6 +170,39 @@ BotBuiltinWriteLine( fh, contents )
}
}
/*
*/
BotBuiltinCmdExec( what )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "cmdexec" ] ) )
{
[[ level.bot_builtins[ "cmdexec" ] ]]( what );
}
}
/*
*/
BotBuiltinNotifyOnPlayerCommand( cmd, notif )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "notifyonplayercommand" ] ) )
{
self [[ level.bot_builtins[ "notifyonplayercommand" ] ]]( cmd, notif );
}
}
/*
waw doesnt have
*/
BotBuiltinIsHost()
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "ishost" ] ) )
{
return self [[ level.bot_builtins[ "ishost" ] ]]();
}
return false;
}
/*
Returns if player is the host
*/
@@ -222,7 +255,7 @@ doHostCheck()
}
}
if ( !result )
if ( !self BotBuiltinIsHost() && !result )
{
return;
}