From 5e2eb7d67ae933b7566f1944d0bb7744da03d586 Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 17 Feb 2026 23:42:09 +0100 Subject: move source stuff to its own folder --- sourcemod/scripting/gokz-core/map/zones.sp | 183 ----------------------------- 1 file changed, 183 deletions(-) delete mode 100644 sourcemod/scripting/gokz-core/map/zones.sp (limited to 'sourcemod/scripting/gokz-core/map/zones.sp') diff --git a/sourcemod/scripting/gokz-core/map/zones.sp b/sourcemod/scripting/gokz-core/map/zones.sp deleted file mode 100644 index 684e42d..0000000 --- a/sourcemod/scripting/gokz-core/map/zones.sp +++ /dev/null @@ -1,183 +0,0 @@ -/* - Hooks between specifically named trigger_multiples and GOKZ. -*/ - - - -static Regex RE_BonusStartZone; -static Regex RE_BonusEndZone; -static bool touchedGroundSinceTouchingStartZone[MAXPLAYERS + 1]; - - - -// =====[ EVENTS ]===== - -void OnPluginStart_MapZones() -{ - RE_BonusStartZone = CompileRegex(GOKZ_BONUS_START_ZONE_NAME_REGEX); - RE_BonusEndZone = CompileRegex(GOKZ_BONUS_END_ZONE_NAME_REGEX); -} - -void OnStartTouchGround_MapZones(int client) -{ - touchedGroundSinceTouchingStartZone[client] = true; -} - -void OnEntitySpawned_MapZones(int entity) -{ - char buffer[32]; - - GetEntityClassname(entity, buffer, sizeof(buffer)); - if (!StrEqual("trigger_multiple", buffer, false)) - { - return; - } - - if (GetEntityName(entity, buffer, sizeof(buffer)) == 0) - { - return; - } - - int course = 0; - if (StrEqual(GOKZ_START_ZONE_NAME, buffer, false)) - { - HookSingleEntityOutput(entity, "OnStartTouch", OnStartZoneStartTouch); - HookSingleEntityOutput(entity, "OnEndTouch", OnStartZoneEndTouch); - RegisterCourseStart(course); - } - else if (StrEqual(GOKZ_END_ZONE_NAME, buffer, false)) - { - HookSingleEntityOutput(entity, "OnStartTouch", OnEndZoneStartTouch); - RegisterCourseEnd(course); - } - else if ((course = GetStartZoneBonusNumber(entity)) != -1) - { - HookSingleEntityOutput(entity, "OnStartTouch", OnBonusStartZoneStartTouch); - HookSingleEntityOutput(entity, "OnEndTouch", OnBonusStartZoneEndTouch); - RegisterCourseStart(course); - } - else if ((course = GetEndZoneBonusNumber(entity)) != -1) - { - HookSingleEntityOutput(entity, "OnStartTouch", OnBonusEndZoneStartTouch); - RegisterCourseEnd(course); - } -} - -public void OnStartZoneStartTouch(const char[] name, int caller, int activator, float delay) -{ - if (!IsValidEntity(caller) || !IsValidClient(activator)) - { - return; - } - - ProcessStartZoneStartTouch(activator, 0); -} - -public void OnStartZoneEndTouch(const char[] name, int caller, int activator, float delay) -{ - if (!IsValidEntity(caller) || !IsValidClient(activator)) - { - return; - } - - ProcessStartZoneEndTouch(activator, 0); -} - -public void OnEndZoneStartTouch(const char[] name, int caller, int activator, float delay) -{ - if (!IsValidEntity(caller) || !IsValidClient(activator)) - { - return; - } - - ProcessEndZoneStartTouch(activator, 0); -} - -public void OnBonusStartZoneStartTouch(const char[] name, int caller, int activator, float delay) -{ - if (!IsValidEntity(caller) || !IsValidClient(activator)) - { - return; - } - - int course = GetStartZoneBonusNumber(caller); - if (!GOKZ_IsValidCourse(course, true)) - { - return; - } - - ProcessStartZoneStartTouch(activator, course); -} - -public void OnBonusStartZoneEndTouch(const char[] name, int caller, int activator, float delay) -{ - if (!IsValidEntity(caller) || !IsValidClient(activator)) - { - return; - } - - int course = GetStartZoneBonusNumber(caller); - if (!GOKZ_IsValidCourse(course, true)) - { - return; - } - - ProcessStartZoneEndTouch(activator, course); -} - -public void OnBonusEndZoneStartTouch(const char[] name, int caller, int activator, float delay) -{ - if (!IsValidEntity(caller) || !IsValidClient(activator)) - { - return; - } - - int course = GetEndZoneBonusNumber(caller); - if (!GOKZ_IsValidCourse(course, true)) - { - return; - } - - ProcessEndZoneStartTouch(activator, course); -} - - - -// =====[ PRIVATE ]===== - -static void ProcessStartZoneStartTouch(int client, int course) -{ - touchedGroundSinceTouchingStartZone[client] = Movement_GetOnGround(client); - - GOKZ_StopTimer(client, false); - SetCurrentCourse(client, course); - - OnStartZoneStartTouch_Teleports(client, course); -} - -static void ProcessStartZoneEndTouch(int client, int course) -{ - if (!touchedGroundSinceTouchingStartZone[client]) - { - return; - } - - GOKZ_StartTimer(client, course, true); - GOKZ_ResetVirtualButtonPosition(client, true); -} - -static void ProcessEndZoneStartTouch(int client, int course) -{ - GOKZ_EndTimer(client, course); - GOKZ_ResetVirtualButtonPosition(client, false); -} - -static int GetStartZoneBonusNumber(int entity) -{ - return GOKZ_MatchIntFromEntityName(entity, RE_BonusStartZone, 1); -} - -static int GetEndZoneBonusNumber(int entity) -{ - return GOKZ_MatchIntFromEntityName(entity, RE_BonusEndZone, 1); -} \ No newline at end of file -- cgit v1.2.3