Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosort PlayerHotkeys on character creation: self == game:getPlayer(true) #25

Open
khonkhortisan opened this issue Oct 4, 2018 · 0 comments
Labels

Comments

@khonkhortisan
Copy link
Owner

khonkhortisan commented Oct 4, 2018

singleplayer

engine/interface/PlayerHotkeys.lua
if self == game:getPlayer(true) then

mod/class/Game.lua
function _M:getPlayer(main)
	if main then
		return self.party:findMember{main=true}
	else
		return self.player
	end
end

if game.party.members[self].main then

-----
getPlayer(false) is for when you don't have a reference to game.player (currently-controlled actor)
game.party.members[self].main is to check whether it's a player
getPlayer(true) is for finding player 1
self == game:getPlayer(true) is for checking whether you're player 1
-----
@khonkhortisan khonkhortisan changed the title PlayerHotkeys PlayerHotkeys: self == game:getPlayer(true) Oct 4, 2018
khonkhortisan added a commit that referenced this issue Oct 6, 2018
sometimes get current player (main=tue, first=false)
sometimes get player1 (main=true, first=true)
sometimes get current actor (main=false)
@khonkhortisan khonkhortisan changed the title PlayerHotkeys: self == game:getPlayer(true) autosort PlayerHotkeys on character creation: self == game:getPlayer(true) Nov 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant