1
0
Pārlūkot izejas kodu

[Fixed] Infinite loop causing crash in therapist event

Awesome 1 mēnesi atpakaļ
vecāks
revīzija
08d2318b2f
1 mainītis faili ar 14 papildinājumiem un 12 dzēšanām
  1. 14 12
      locations/lover.qsrc

+ 14 - 12
locations/lover.qsrc

@@ -111,24 +111,26 @@ end
 if $ARGS[0] = 'clear_all':
 	! CLEAR LOVERS
 	! THIS IS A NUCLEAR OPTION!
-
+	temp_lover_index = 0
 	:clear_lovers_loop
-	if arrsize('$lover') > 0:
-		if $npc_rel_type[$lover[0]] = 'boyfriend':
-			gs 'lover', 'remove_boyfriend', $lover[0]
-		elseif $npc_rel_type[$lover[0]] = 'girlfriend':
-			gs 'lover', 'remove_girlfriend', $lover[0]
-		elseif $npc_rel_type[$lover[0]] = 'fuckbuddy':
-			gs 'lover', 'remove_fuckbuddy', $lover[0]
-		elseif $npc_rel_type[$lover[0]] = 'sugar_daddy':
-			gs 'lover', 'remove_sugar_daddy', $lover[0]
-		elseif $npc_rel_type[$lover[0]] = 'husband':
-			gs 'lover', 'remove_husband', $lover[0]
+	if arrsize('$lover') > temp_lover_index:
+		if $npc_rel_type[$lover[temp_lover_index]] = 'boyfriend':
+			gs 'lover', 'remove_boyfriend', $lover[temp_lover_index]
+		elseif $npc_rel_type[$lover[temp_lover_index]] = 'girlfriend':
+			gs 'lover', 'remove_girlfriend', $lover[temp_lover_index]
+		elseif $npc_rel_type[$lover[temp_lover_index]] = 'fuckbuddy':
+			gs 'lover', 'remove_fuckbuddy', $lover[temp_lover_index]
+		elseif $npc_rel_type[$lover[temp_lover_index]] = 'sugar_daddy':
+			gs 'lover', 'remove_sugar_daddy', $lover[temp_lover_index]
+		elseif $npc_rel_type[$lover[temp_lover_index]] = 'husband':
+			gs 'lover', 'remove_husband', $lover[temp_lover_index]
 			gs 'lover_love', 'divorce'
 
 		end
+		temp_lover_index += 1
 		jump 'clear_lovers_loop'
 	end
+	killvar'temp_lover_index'
 end