mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2026-06-17 18:52:12 +00:00
fix: add file handling functions for bot built-ins
Loading all waypoint data at once crashes on real hardware on various maps, narrowed it down to those maps with bigger waypoint files. Using a streamed file reader seems to work better but there might be a "better" fix to look at in the future.
This commit is contained in:
@@ -4,6 +4,9 @@ init()
|
||||
level.bot_builtins[ "filewrite" ] = ::do_filewrite;
|
||||
level.bot_builtins[ "fileread" ] = ::do_fileread;
|
||||
level.bot_builtins[ "fileexists" ] = ::do_fileexists;
|
||||
level.bot_builtins[ "openfile" ] = ::do_openfile;
|
||||
level.bot_builtins[ "readstream" ] = ::do_readstream;
|
||||
level.bot_builtins[ "closefile" ] = ::do_closefile;
|
||||
level.bot_builtins[ "botaction" ] = ::do_botaction;
|
||||
level.bot_builtins[ "botstop" ] = ::do_botstop;
|
||||
level.bot_builtins[ "botmovement" ] = ::do_botmovement;
|
||||
@@ -35,6 +38,22 @@ do_fileexists( file )
|
||||
return fileexists( file );
|
||||
}
|
||||
|
||||
do_openfile( file, mode )
|
||||
{
|
||||
file = "scriptdata/" + file;
|
||||
return openfile( file, mode );
|
||||
}
|
||||
|
||||
do_readstream()
|
||||
{
|
||||
return readstream();
|
||||
}
|
||||
|
||||
do_closefile()
|
||||
{
|
||||
return closefile();
|
||||
}
|
||||
|
||||
do_botaction( action )
|
||||
{
|
||||
self botaction( action );
|
||||
|
||||
Reference in New Issue
Block a user