<commit_before>--Checks if the playable faction leaders is logged in and thus the NPC needs to be out of player sight

require("base.common")

module("scheduled.factionLeader", package.seeall)

function checkFactionLeader()

	players=world:getPlayersOnline()
	for index, playerName in pairs(players) do
		if playerName == "<NAME>" then
			npcPositions = {position(122, 521, 0), position(237, 104, 0)};
			updatePosition(npcPositions)
		elseif playerName == "<NAME>" then
			npcPositions = {position(337, 215, 0), position(238, 104, 0)};
			updatePosition(npcPositions)
		elseif playerName == "<NAME>" then
			npcPositions = {position(898, 775, 2), position(239, 104, 0)};
			updatePosition(npcPositions)
		end
	end
end

function updatePosition(npcPositions)
	if world:isCharacterOnField(npcPositions[1]) == true then
		npcCharObject = world:getCharacterOnField(npcPositions[1]);
		npcCharObject:forceWarp(npcPositions[2]);
	end
end<commit_msg>fixed if statement..i think<commit_after>--Checks if the playable faction leaders is logged in and thus the NPC needs to be out of player sight

require("base.common")

module("scheduled.factionLeader", package.seeall)

function checkFactionLeader()

	players=world:getPlayersOnline()
	for index, player in pairs(players) do
		if player.name == "<NAME>" then
			npcPositions = {usualPosition=position(122, 521, 0), newPosition=position(237, 104, 0)};
			updatePosition(npcPositions)
		elseif player.name == "<NAME>" then
			npcPositions = {usualPosition=position(337, 215, 0), newPosition=position(238, 104, 0)};
			updatePosition(npcPositions)
		elseif player.name == "<NAME>" then
			npcPositions = {usualPosition=position(898, 775, 2), newPosition=position(239, 104, 0)};
			updatePosition(npcPositions)
		end
	end
end

function updatePosition(npcPositions)
	if world:isCharacterOnField(npcPositions.usualPosition) == true then
		npcCharObject = world:getCharacterOnField(npcPositions.usualPosition);
		npcCharObject:forceWarp(npcPositions.newPosition);
	end
end
{'fraction_non_alphanumeric': 0.1145418326693227, 'fraction_numerical': 0.04332669322709164, 'mean_word_length': 6.175, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7192013', 'n_tokens_mistral': 768, 'n_tokens_neox': 650, 'n_words': 166}