浏览代码

Fix possible adding of duplcate fuckbuddy.

HotMike 1 年之前
父节点
当前提交
aedda5ef45
共有 1 个文件被更改,包括 6 次插入3 次删除
  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':