Solution with "setTeamToBattleTeam"

Discussion in 'Development General' started by LanZero, Apr 4, 2016.

  1. LanZero

    LanZero New Member

    Joined:
    Nov 21, 2015
    Messages:
    10
    Likes Received:
    2
    Hello again , today I come to ask that serious possible way again activate the " setTeamToBattleTeam " . It is that modules that were used for this function were separated for battleserver . I still think that somehow must be able to reuse. I hope I draw from my doubt and greetings .

    This is the function:

    void ScriptEngine::setTeamToBattleTeam(int pid, int teamSlot, int battleId)
    {
    if (!testTeamCount("setTeamToBattleTeam", pid, teamSlot)) {
    return;
    }
    BattleBase * battle = myserver->getBattle(battleId);
    if (battle) {
    if (battle->spot(pid) == -1) {
    warn("setTeamToBattleTeam", QString("Player %1 doesn't take part in battle %2").arg(pid, battleId));
    return;
    }
    TeamBattle team = battle->team(battle->spot(pid));
    team.resetIndexes();
    myserver->player(pid)->team(teamSlot) = team;
    } else{
    warn("setTeamToBattleTeam", "can't find a battle with specified id.");
    }
    }
     
    Pumone likes this.
  2. Pumone

    Pumone Member

    Joined:
    Aug 30, 2015
    Messages:
    63
    Likes Received:
    14
    Does this script let you watch a battle where 2 AI teams fight each other?
     
  3. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    it needs to make a network request and be asynchroneous...