View Issue Details

IDProjectCategoryView StatusLast Update
0004113Spring engineGeneralpublic2013-11-04 14:00
Reportersilentwings Assigned ToKloot  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version94.1.1+git 
Summary0004113: when hosting an AI team, GetMyPlayerID and GetMyTeamID return the pID,tID of the AI
Descriptionheres what I was doing:

i hosted a battle, 2 allyteams, first allyteam contained just me, second allyteam contained one human player and a NullAI hosted by me.

once ingame, when i called Spring.GetMy***ID(), it returned the information relating to the AI i was hosting and not my own info.
Additional Informationit might have mattered that the AI had a numerically lower pID and tID than me?
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

silentwings

2013-11-03 21:59

reporter   ~0011951

Last edited: 2013-11-03 22:03

this was with Spring 94.1.1-1452 and latest SL dev build

silentwings

2013-11-03 22:17

reporter   ~0011954

Last edited: 2013-11-03 22:18

correction: GetMyPlayerID seems to return correctly, GetMyTeamID returned the AIs teamID

Kloot

2013-11-03 22:32

developer   ~0011955

Sounds like myTeam is set twice, once for you and once for the AI hosted by you.

Look in infolog if there is more than one "User number %i (team %i, allyteam %i)" message to confirm this.

silentwings

2013-11-03 22:35

reporter   ~0011956

Last edited: 2013-11-03 22:47

There's only one such message in the infolog but the teamID it gives corresponds to the AIs team.
I tried:
local myPlayerID = Spring.GetMyPlayerID()
local _,_,_,myTeamID = Spring.GetPlayerInfo(myPlayerID)
but this gives the same incorrect teamID as Spring.GetMyTeamID()

silentwings

2013-11-03 22:42

reporter   ~0011957

script.txt is http://pastebin.com/eEqKfQip

I spotted that two teams that have different allyTeams are given the same teamleader - that strikes me as a bit odd?

Kloot

2013-11-03 23:09

developer   ~0011960

Somewhat, the leader is the player "in charge" of a team (not allyteam). For AI teams (friend or foe) hosted on the same machine that gets weird but it shouldn't affect one's team number, AI's cannot displace humans.

According to the script three teams should have spawned, I assume that still happened normally?

  player 1 in team 1 in allyteam 1
  player 2 in team 2 in allyteam 0
  "player" 3 (AI 0) in team 0 in allyteam 1

silentwings

2013-11-03 23:29

reporter   ~0011961

yes the alliances were correct & all three spawned

it seems non-reproducable after closing and re-opening my battle, no matter how many AIs i add :/ if i can make it happen again i'll re-post

abma

2013-11-03 23:43

administrator   ~0011962

https://github.com/spring/spring/commit/28987712f5fd0432929e74d24dd8bff2f3313617

Issue History

Date Modified Username Field Change
2013-11-03 21:58 silentwings New Issue
2013-11-03 21:59 silentwings Note Added: 0011951
2013-11-03 22:03 silentwings Note Edited: 0011951
2013-11-03 22:17 silentwings Note Added: 0011954
2013-11-03 22:18 silentwings Note Edited: 0011954
2013-11-03 22:32 Kloot Note Added: 0011955
2013-11-03 22:35 silentwings Note Added: 0011956
2013-11-03 22:35 silentwings Note Edited: 0011956
2013-11-03 22:37 silentwings Note Edited: 0011956
2013-11-03 22:42 silentwings Note Added: 0011957
2013-11-03 22:47 silentwings Note Edited: 0011956
2013-11-03 23:09 Kloot Note Added: 0011960
2013-11-03 23:29 silentwings Note Added: 0011961
2013-11-03 23:43 abma Note Added: 0011962
2013-11-04 14:00 Kloot Status new => closed
2013-11-04 14:00 Kloot Assigned To => Kloot
2013-11-04 14:00 Kloot Resolution open => unable to reproduce