fix #724: revers the order in which GetCrew(plr,index) returns the crew

scancodes-fix
Tobias Zwick 2013-01-13 15:45:51 +01:00
parent 65d50da83f
commit 28e2bdbb92
4 changed files with 11 additions and 13 deletions

View File

@ -34,7 +34,7 @@ protected func Construction()
progress_bar_links = [];
// find all clonks of this crew which do not have a selector yet (and can have one)
for(var i=GetCrewCount(GetOwner())-1; i >= 0; --i)
for(var i=0; i < GetCrewCount(GetOwner()); ++i)
{
var crew = GetCrew(GetOwner(),i);
if(!(crew->HUDAdapter())) continue;
@ -643,10 +643,8 @@ private func CreateSelectorFor(object clonk)
/** Rearranges the CrewSelectors in the correct order */
private func ReorderCrewSelectors(object leaveout)
{
// somehow new crew gets sorted at the beginning
// because we dont want that, the for loop starts from the end
var j = 0;
for(var i=GetCrewCount(GetOwner())-1; i >= 0; --i)
for(var i=0; i < GetCrewCount(GetOwner()); ++i)
{
var spacing = 12;
var crew = GetCrew(GetOwner(),i);

View File

@ -711,12 +711,12 @@
# Crew
[Assignment]
Key=R
Key=T
GUIGroup=70
Control=PreviousCrew
[Assignment]
Key=T
Key=R
GUIGroup=70
Control=NextCrew
@ -844,12 +844,12 @@
# Crew
[Assignment]
Key=P
Key=Y
Control=PreviousCrew
GUIGroup=70
[Assignment]
Key=Y
Key=P
Control=NextCrew
GUIGroup=70

View File

@ -126,7 +126,7 @@ protected func InitializePlayer(int plr)
SetPlayerZoomByViewRange(plr, 400, nil, PLRZOOM_Direct);
// First clonk.
clonk = GetCrew(plr, 1);
clonk = GetCrew(plr, 0);
clonk->SetPosition(200, 440);
effect = AddEffect("ClonkOneRestore", clonk, 100, 10);
effect.to_x = 200;
@ -145,14 +145,14 @@ protected func InitializePlayer(int plr)
effect.to_container = clonk;
// Second clonk.
clonk = GetCrew(plr, 0);
clonk = GetCrew(plr, 1);
clonk->SetPosition(30, 680);
effect = AddEffect("ClonkTwoRestore", clonk, 100, 10);
effect.to_x = 30;
effect.to_y = 680;
// Select first clonk
SetCursor(plr, GetCrew(plr, 1));
SetCursor(plr, GetCrew(plr, 0));
// Create tutorial guide, add messages, show first.
guide = CreateTutorialGuide(plr);

View File

@ -476,7 +476,7 @@ void C4Player::PlaceReadyCrew(int32_t tx1, int32_t tx2, int32_t ty, C4Object *Fi
if ((nobj=Game.CreateInfoObject(pInfo,Number,ctx,cty)))
{
// Add object to crew
Crew.Add(nobj, C4ObjectList::stMain);
Crew.Add(nobj, C4ObjectList::stNone);
// add visibility range
nobj->SetPlrViewRange(C4FOW_Def_View_RangeX);
// If base is present, enter base
@ -1033,7 +1033,7 @@ bool C4Player::MakeCrewMember(C4Object *pObj, bool fForceInfo, bool fDoCalls)
// Add to crew
if (!Crew.GetLink(pObj))
Crew.Add(pObj, C4ObjectList::stMain);
Crew.Add(pObj, C4ObjectList::stNone);
// add plr view
if (!pObj->PlrViewRange) pObj->SetPlrViewRange(C4FOW_Def_View_RangeX); else pObj->PlrFoWActualize();