Explorar el Código

Fix possible adding of duplcate fuckbuddy.

HotMike hace 1 año
padre
commit
aedda5ef45
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6 3
      locations/lover.qsrc

+ 6 - 3
locations/lover.qsrc

@@ -140,9 +140,12 @@ if $ARGS[0] = 'add fuckbuddy':
 	else
 		gs 'boyStat',$ARGS[1]
 	end
-	$fuckbuddy[] = $boy
-	$npc_rel_type[$boy] = 'fuckbuddy'
-	gs 'telefon', 'AddContact', $boy, $npc_pic[$boy],'',"hour >= 8 and hour <= 22",'', "hour >= 8 and hour <= 22", 0
+	! Do not add when he has already been added.
+	if arrpos('$fuckbuddy',$boy) = -1:
+		$fuckbuddy[] = $boy
+		$npc_rel_type[$boy] = 'fuckbuddy'
+		gs 'telefon', 'AddContact', $boy, $npc_pic[$boy],'',"hour >= 8 and hour <= 22",'', "hour >= 8 and hour <= 22", 0
+	end
 end
 
 if $ARGS[0] = 'remove fuckbuddy':