Commit Graph
53 Commits
Author SHA1 Message Date
smallmodel ab43a0def6 fix(fgame): only throw an error if the target name is not found when g_scriptdebug is set 2026-03-06 00:57:52 +01:00
smallmodel a3f520de8c Format most source files 2025-07-19 23:30:20 +02:00
smallmodel 1ea273fba0 Clear the top stack result when self is NULL 2025-01-18 13:02:05 +01:00
smallmodel 6b02457190 Properly correct the opcode in OP_LOAD_STORE_SELF_VAR when self is NULL 2025-01-17 16:49:38 +01:00
smallmodel 87e5b6d41e Clear the top variable when the event is not valid too 2025-01-17 16:21:13 +01:00
smallmodel 539c2df378 Check for valid event on listener and print an error if the command cannot be executed 2025-01-16 23:25:26 +01:00
smallmodel 2dbe61789d Don't use the target list if the world is NULL 2025-01-15 18:29:35 +01:00
smallmodel 3d454c90cb Rework the target list, use a container instead of an hash set so the target list gets archived correctly
This fixes an issue when loading from a save. A variable referencing target list container would have random entities in it, which would cause errors and crashes when trying to do an action on the array of entities
2024-10-22 20:05:53 +02:00
smallmodel f9d264058b Use safe version of sprintf and strcpy 2024-09-20 23:08:53 +02:00
smallmodel 322ca2b42e Fix the loop protection not working when multiple scripts are executed
This fix will apply the protection globally
2024-08-24 18:50:04 +02:00
smallmodel 2f48ca6adb Adds assertion check to check if top stack is out of bounds 2024-06-22 19:03:27 +02:00
smallmodel 6731f56aea Fixed m_PrevCodePos usage 2024-04-10 23:42:09 +02:00
smallmodel 302f06f8d2 Clear the variable if the field cannot be found 2024-03-03 18:54:22 +01:00
smallmodel 8a3b62e93f Fixed targetname error 2024-02-16 23:50:57 +01:00
smallmodel 0ed92943de Fixed commands not being executed properly on a specific type of array of listeners 2024-02-03 23:22:06 +01:00
smallmodel 2ac2800ecb Only archive used variables on the local VM stack 2023-11-28 19:14:09 +01:00
smallmodel fad555308b Archive ScriptVM and ScriptThread appropriately 2023-11-27 19:30:40 +01:00
smallmodel 37de859bee Fixed field var breaking code position on exception 2023-11-14 00:16:09 +01:00
smallmodel befcedcf58 Fixed OPCODE_STORE_FIELD_REF incorrectly not skipping field on exception
It would cause invalid opcode afterwards.
2023-11-14 00:06:23 +01:00
smallmodel e8aad97975 Fixed alignment issue on ARM CPUs 2023-11-13 23:28:42 +01:00
smallmodel 1698f6d1bf The return value of an event must be the first value 2023-11-02 19:53:26 +01:00
smallmodel 7c5c34741c Added more script trace and initialize state to STATE_EXECUTION in ScriptVM constructor 2023-11-01 16:52:30 +01:00
smallmodel ff3ee39830 Fixed field name not showing in the exception message 2023-10-31 20:39:28 +01:00
smallmodel dd1f8bd92a Compare with STATE_RUNNING instead 2023-10-30 22:46:59 +01:00
smallmodel 57e450a745 Thread state fix 2023-10-27 20:41:47 +02:00
smallmodel 481cd760a9 Added ScriptTrace/GetSourcePos 2023-10-27 20:00:48 +02:00
smallmodel 0f7691c722 Reordered NotifyDelete switch statement for more clarity 2023-10-26 20:17:42 +02:00
smallmodel f01a0a17c1 Added script traces 2023-10-26 20:13:07 +02:00
smallmodel d757fa6306 Renamed world.cpp and world.h to worldspawn.cpp and worldspawn.h 2023-10-08 00:08:47 +02:00
smallmodel 673a42242d Formatted source files 2023-10-01 22:47:25 +02:00
smallmodel 3317345d92 Use a const string for target name 2023-10-01 22:45:41 +02:00
smallmodel c5a46be23e Optimized calls to Event() (avoid allocating a new Event when it can be reused) 2023-09-07 18:22:07 +02:00
smallmodel 47a3c0bf55 Optimized event name
Use a static char*, instead of an allocated str
2023-09-07 18:05:49 +02:00
smallmodel a99a4a3a2b Clear the top value of a return command, if the listener is NULL 2023-08-30 23:34:29 +02:00
smallmodel 1a03288144 SetFastData: Move the ScriptVariable instead of copying it 2023-08-19 20:47:36 +02:00
smallmodel b9f3ee867b Fixed switch label with "default" case 2023-08-19 00:57:29 +02:00
smallmodel 28de2543ec Removed listenerVars as it can cause issues 2023-08-17 19:51:53 +02:00
smallmodel 911d1f1706 Fixed OP_STORE_FIELD and OP_STORE_FIELD_REF 2023-08-17 16:07:38 +02:00
smallmodel 56fba733f3 Always cast targetlist to const array value, so the iteration remains untouched 2023-08-17 03:18:41 +02:00
smallmodel 73bc196592 Fixed cmd execution while iterating over a target list 2023-08-17 03:04:01 +02:00
smallmodel efed6d0eac Fixed script developer printf 2023-08-16 02:43:22 +02:00
smallmodel 421126db38 Optimized ScriptVM::EventGoto 2023-08-13 22:07:33 +02:00
smallmodel 8b17d81545 Fixed variables improperly used on stack under some circumstances 2023-08-13 20:17:59 +02:00
smallmodel f857116f75 Fixed script crashes 2023-08-13 17:59:49 +02:00
smallmodel 0dda70cca1 Fixed event parameters being wrong 2023-08-13 03:34:19 +02:00
smallmodel 68d48d9889 Used clang-format on some common files 2023-07-05 21:24:02 +02:00
OM 51116b933d Fixed code_pos being wrong after loadTop/storeTop 2023-07-04 23:16:35 +02:00
OM fd871d6c8f avoid incrementing m_CodePos in OP_STORE_STRING and OP_STORE_VECTOR as fetchOpcodeValue() already does that 2023-07-04 23:06:33 +02:00
OM c287638f99 Reworked file inclusion (using relative path) 2023-06-17 01:24:20 +02:00
L fbd03b6a26 Debloated g_local.h include files 2023-04-29 21:56:38 +02:00