diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 530d28414..ddc982cc7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,6 +82,7 @@ if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only endif() add_subdirectory(blua) +add_subdirectory(ACS) add_subdirectory(blan) add_subdirectory(objects) @@ -355,3 +356,4 @@ add_subdirectory(sdl) if(NOT ${SRB2_SDL2_AVAILABLE}) message(FATAL_ERROR "There are no targets available to build an SRB2Kart executable. :(") endif() + diff --git a/src/k_acs-func.c b/src/k_acs-func.c index 257fc5e44..ca5e8af08 100644 --- a/src/k_acs-func.c +++ b/src/k_acs-func.c @@ -201,7 +201,7 @@ bool ACS_CF_Random(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC low = argV[0]; high = argV[1]; - ACSVM_Thread_DataStk_Push(thread, P_RandomRange(PR_ACS, low, high)); + ACSVM_Thread_DataStk_Push(thread, P_RandomRange(low, high)); return false; } diff --git a/src/k_acs.c b/src/k_acs.c index 94c822680..544e9a130 100644 --- a/src/k_acs.c +++ b/src/k_acs.c @@ -28,13 +28,13 @@ #include "p_tick.h" #include "p_local.h" -#include "CAPI/BinaryIO.h" -#include "CAPI/Environment.h" -#include "CAPI/Module.h" -#include "CAPI/PrintBuf.h" -#include "CAPI/Scope.h" -#include "CAPI/String.h" -#include "CAPI/Thread.h" +#include "ACS/CAPI/BinaryIO.h" +#include "ACS/CAPI/Environment.h" +#include "ACS/CAPI/Module.h" +#include "ACS/CAPI/PrintBuf.h" +#include "ACS/CAPI/Scope.h" +#include "ACS/CAPI/String.h" +#include "ACS/CAPI/Thread.h" static ACSVM_Environment *ACSenv = NULL; @@ -620,14 +620,14 @@ void ACS_LoadLevelScripts(size_t mapID) // Insert BEHAVIOR lump into the list. { - char const *str = mapheaderinfo[mapID]->lumpname; + char const *str = va("MAP%lu",mapID); size_t len = strlen(str); size_t hash = ACSVM_StrHash(str, len); ACSVM_ModuleName name = {0}; name.s = ACSVM_StringTable_GetStringByData(strTab, str, len, hash); - name.i = mapheaderinfo[mapID]->lumpnum; + name.i = mapID; if (modules_len >= modules_size) { diff --git a/src/k_acs.h b/src/k_acs.h index 227787307..f90d37126 100644 --- a/src/k_acs.h +++ b/src/k_acs.h @@ -21,13 +21,13 @@ #include "p_polyobj.h" #include "d_player.h" -#include "CAPI/BinaryIO.h" -#include "CAPI/Environment.h" -#include "CAPI/Module.h" -#include "CAPI/PrintBuf.h" -#include "CAPI/Scope.h" -#include "CAPI/String.h" -#include "CAPI/Thread.h" +#include "ACS/CAPI/BinaryIO.h" +#include "ACS/CAPI/Environment.h" +#include "ACS/CAPI/Module.h" +#include "ACS/CAPI/PrintBuf.h" +#include "ACS/CAPI/Scope.h" +#include "ACS/CAPI/String.h" +#include "ACS/CAPI/Thread.h" // // Special global script types.