Home » MODDING HQ 1.13 » v1.13 General Development Talk » Any introduction to the code?
Re: Any introduction to the code?[message #357803 is a reply to message #357802]
|
Thu, 08 August 2019 12:12 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
MH17 |
![](/images/ranks/corporal.png) |
Messages:46
Registered:November 2018 Location: Antarctica |
|
|
Thanks, bro!
Unfortunately I'm not on my PC at the moment, and I have no idea why the SVN doesnt allow me to create patches from here.
Please, have a look on the modified piece of code with the aforementioned "while"-loop, hope it will help.
unsigned firstSlot = gTacticalStatus.Team[ENEMY_TEAM].bFirstID;
unsigned lastSlot = gTacticalStatus.Team[ENEMY_TEAM].bLastID;
unsigned slotsAvailable = lastSlot - firstSlot + 1;
while( pGroup && sNumSlots > 0 )
{
if ( pGroup->usGroupTeam != OUR_TEAM && !pGroup->fVehicle &&
pGroup->ubSectorX == gWorldSectorX && pGroup->ubSectorY == gWorldSectorY && !gbWorldSectorZ )
{
ubNumAdmins = pGroup->pEnemyGroup->ubAdminsInBattle;
ubNumTroops = pGroup->pEnemyGroup->ubTroopsInBattle;
ubNumElites = pGroup->pEnemyGroup->ubElitesInBattle;
ubNumTanks = pGroup->pEnemyGroup->ubTanksInBattle;
ubNumJeeps = pGroup->pEnemyGroup->ubJeepsInBattle;
unsigned num = ubNumAdmins + ubNumTroops + ubNumElites + ubNumTanks + ubNumJeeps;
AssertGE((int)slotsAvailable, sNumSlots);
for (unsigned slot = firstSlot;
(slot <= lastSlot) && num && sNumSlots;
++slot)
{
pSoldier = &Menptr[ slot ];
// Skip inactive and already grouped soldiers
if (!pSoldier->bActive || pSoldier->ubGroupID)
{
// if this guy already has an ID, reduce the number of people who still need one
--num;
--sNumSlots;
continue;
}
// At this point we should not have added more soldiers than are in slots
AssertGT( sNumSlots, 0 );
switch( pSoldier->ubSoldierClass )
{
case SOLDIER_CLASS_ADMINISTRATOR:
if( ubNumAdmins )
{
num--;
sNumSlots--;
ubNumAdmins--;
pSoldier->ubGroupID = pGroup->ubGroupID;
firstSlot = slot + 1;
}
break;
case SOLDIER_CLASS_ARMY:
if( ubNumTroops )
{
num--;
sNumSlots--;
ubNumTroops--;
pSoldier->ubGroupID = pGroup->ubGroupID;
firstSlot = slot + 1;
}
break;
case SOLDIER_CLASS_ELITE:
if( ubNumElites )
{
num--;
sNumSlots--;
ubNumElites--;
pSoldier->ubGroupID = pGroup->ubGroupID;
firstSlot = slot + 1;
}
break;
// silversurfer: bugfix for Jaggzilla bug #623
// Mike or Iggy can be part of the enemy team and they are created from an Elite but they don't have SOLDIER_CLASS_ELITE.
// Therefore once this for loop was done ubNumElites was still 1 which caused an assertion error.
case SOLDIER_CLASS_NONE:
if( ubNumElites )
{
if ( pSoldier->ubProfile == MIKE || pSoldier->ubProfile == IGGY )
{
num--;
sNumSlots--;
ubNumElites--;
pSoldier->ubGroupID = pGroup->ubGroupID;
firstSlot = slot + 1;
}
}
break;
case SOLDIER_CLASS_TANK:
if( ubNumTanks )
{
num--;
sNumSlots--;
ubNumTanks--;
pSoldier->ubGroupID = pGroup->ubGroupID;
firstSlot = slot + 1;
}
break;
case SOLDIER_CLASS_JEEP:
if ( ubNumJeeps )
{
num--;
sNumSlots--;
ubNumJeeps--;
pSoldier->ubGroupID = pGroup->ubGroupID;
firstSlot = slot + 1;
}
break;
}
}
// Flugente: instead of just crashing the game without any explanation to the user, ignore this issue if it still exists.
// The worst that should happen is a warning that a soldier has no group id.
/*AssertEQ( ubNumElites , 0);
AssertEQ( ubNumTroops , 0);
AssertEQ( ubNumAdmins , 0);
AssertEQ( ubNumTanks , 0);
AssertEQ( ubNumJeeps , 0);
AssertEQ( num , 0);*/
}
pGroup = pGroup->next;
}
And please, apply your changes from message #357784 (file "Overhead.cpp") to deal the with zombies:
pSectorInfo->ubNumCreatures = 0
pSectorInfo->ubCreaturesInBattle = 0
Report message to a moderator
|
Corporal
|
|
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
![icon12.gif](/images/message_icons/icon12.gif) |
Any introduction to the code?
By: MH17 on Tue, 23 July 2019 01:45
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Tue, 30 July 2019 05:04
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Wed, 31 July 2019 09:39
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sat, 03 August 2019 12:08
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Sat, 03 August 2019 21:27
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sun, 04 August 2019 08:43
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Sun, 04 August 2019 09:58
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sun, 04 August 2019 10:26
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sun, 04 August 2019 11:12
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Mon, 05 August 2019 10:36
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Mon, 05 August 2019 14:41
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
![icon14.gif](/images/message_icons/icon14.gif) |
Re: Any introduction to the code?
By: MH17 on Tue, 06 August 2019 05:25
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
![icon9.gif](/images/message_icons/icon9.gif) |
Re: Any introduction to the code?
By: MH17 on Tue, 06 August 2019 07:28
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Wed, 07 August 2019 07:51
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Thu, 08 August 2019 11:35
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Thu, 08 August 2019 11:43
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Thu, 08 August 2019 12:12
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Thu, 08 August 2019 12:39
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Thu, 08 August 2019 12:59
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Thu, 08 August 2019 13:10
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Thu, 08 August 2019 13:45
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Thu, 08 August 2019 20:53
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sun, 11 August 2019 14:57
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
![film28.png](/images/message_icons/film28.png) |
Re: Any introduction to the code?
By: MH17 on Thu, 22 August 2019 11:35
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Fri, 23 August 2019 03:22
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Fri, 23 August 2019 12:56
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: Deleted. on Fri, 23 August 2019 13:13
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sat, 24 August 2019 10:29
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sat, 24 August 2019 12:00
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
By: MH17 on Sun, 25 August 2019 01:35
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: Any introduction to the code?
|
Goto Forum:
Current Time: Wed Feb 12 21:05:34 GMT+2 2025
Total time taken to generate the page: 0.01001 seconds
|