~parasiteofchar/s25rttr/AIpoc2

« back to all changes in this revision

Viewing changes to src/GameCommands.cpp

  • Committer: poc
  • Date: 2015-02-14 18:27:20 UTC
  • Revision ID: parasiteofchar@googlemail.com-20150214182720-9p884ms594wgs1j1
new addon: Individual Custom Military
allows players to set the requested_soldier count for each individual military building

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
                case ORDERNEWSOLDIERS: return new OrderNewSoldiers(ser);
75
75
                case SENDSOLDIERSHOME: return new SendSoldiersHome(ser);
76
76
                case NOTIFYALLIESOFLOCATION: return new NotifyAlliesOfLocation(ser);
 
77
                case REQUESTED_SOLDIERS_INC: return new RequestedSoldiersInc(ser);
 
78
                case REQUESTED_SOLDIERS_DEC: return new RequestedSoldiersDec(ser);
 
79
                case REQUESTED_SOLDIERS_RES: return new RequestedSoldiersRes(ser);
77
80
    }
78
81
 
79
82
    return NULL;
176
179
            gwg.GetSpecObj<nobMilitary>(x, y)->SendSoldiersHome();
177
180
    }
178
181
}
 
182
void RequestedSoldiersInc::Execute(GameWorldGame& gwg, GameClientPlayer& player, const unsigned char playerid)
 
183
{
 
184
    if(gwg.GetNO(x, y)->GetGOT() == GOT_NOB_MILITARY)
 
185
    {
 
186
        if(gwg.GetSpecObj<nobMilitary>(x, y)->GetPlayer() == playerid)
 
187
            gwg.GetSpecObj<nobMilitary>(x, y)->RequestedSoldiersInc();
 
188
    }
 
189
}
 
190
void RequestedSoldiersDec::Execute(GameWorldGame& gwg, GameClientPlayer& player, const unsigned char playerid)
 
191
{
 
192
    if(gwg.GetNO(x, y)->GetGOT() == GOT_NOB_MILITARY)
 
193
    {
 
194
        if(gwg.GetSpecObj<nobMilitary>(x, y)->GetPlayer() == playerid)
 
195
                        gwg.GetSpecObj<nobMilitary>(x, y)->RequestedSoldiersDec();
 
196
    }
 
197
}
 
198
void RequestedSoldiersRes::Execute(GameWorldGame& gwg, GameClientPlayer& player, const unsigned char playerid)
 
199
{
 
200
    if(gwg.GetNO(x, y)->GetGOT() == GOT_NOB_MILITARY)
 
201
    {
 
202
        if(gwg.GetSpecObj<nobMilitary>(x, y)->GetPlayer() == playerid)
 
203
            gwg.GetSpecObj<nobMilitary>(x, y)->RequestedSoldiersRes();
 
204
    }
 
205
}
179
206
void OrderNewSoldiers::Execute(GameWorldGame& gwg, GameClientPlayer& player, const unsigned char playerid)
180
207
{
181
208
    if(gwg.GetNO(x, y)->GetGOT() == GOT_NOB_MILITARY)