insert players at end of list (preserve index numbers)

This commit is contained in:
Jonathan Lamothe
2019-09-28 01:46:28 -04:00
parent 767c9b9221
commit ac92182b20
3 changed files with 8 additions and 7 deletions

View File

@@ -182,7 +182,8 @@ selectPlayerPrompt pStr callback = Prompt
& cpsName .~ sStr
& cpsSuccessCallback .~ do
modify $ progMode .~ mode
callback (Just 0)
pIndex <- pred . length <$> gets (view $ database.dbPlayers)
callback $ Just pIndex
& cpsFailureCallback .~ do
modify $ progMode .~ mode
callback Nothing