Home » MODDING HQ 1.13 » v1.13 General Development Talk » Any introduction to the code?
Re: Any introduction to the code?[message #357784 is a reply to message #357781]
|
Mon, 05 August 2019 14:41 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Deleted. |
![](/images/ranks/liutenant.png) |
Messages:2656
Registered:December 2012 Location: Russian Federation |
|
|
@MH17
In Tactical\Overhead.cpp:
void RemoveStaticEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
{
if ( !bMapZ ) // Battle ended Above-ground
{
SECTORINFO *pSectorInfo = &(SectorInfo[SECTOR( sMapX, sMapY )]);
pSectorInfo->ubNumAdmins = pSectorInfo->ubNumTroops = pSectorInfo->ubNumElites = 0;
pSectorInfo->ubAdminsInBattle = pSectorInfo->ubTroopsInBattle = pSectorInfo->ubElitesInBattle = 0;
}
else
{
UNDERGROUND_SECTORINFO *pSectorInfo;
pSectorInfo = FindUnderGroundSector( sMapX, sMapY, bMapZ );
pSectorInfo->ubNumAdmins = pSectorInfo->ubNumTroops = pSectorInfo->ubNumElites = 0;
pSectorInfo->ubAdminsInBattle = pSectorInfo->ubTroopsInBattle = pSectorInfo->ubElitesInBattle = 0;
}
}
which is called at the end of the battle in CheckForEndOfBattle()
// Kill all enemies. Sometime even after killing all the enemies, there appeares "in battle" enemies in sector info
RemoveStaticEnemiesFromSectorInfo( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
Maybe it would be enough to add
pSectorInfo->ubNumCreatures = 0
pSectorInfo->ubCreaturesInBattle = 0
to RemoveStaticEnemiesFromSectorInfo() to fix the bug?
This still leaves question why this information is not updated when creature is killed.
Looks like this information should be updated in ProcessQueenCmdImplicationsOfDeath(), which updates sector info:
AdjustToNextAnimationFrame->CheckForAndHandleSoldierDeath->HandleSoldierDeath->HandleNPCTeamMemberDeath->ProcessQueenCmdImplicationsOfDeath
but it only updates sector data for all creatures except bloodcats (bugs, zombies...?), and for bloodcats it only decrements bBloodCats
if( pSector->bBloodCats )
{
pSector->bBloodCats--;
}
and calls HandleBloodCatDeaths() (but only for UB)
#ifdef JA2UB
//JA25 UB
//handle anything important when bloodcats die
HandleBloodCatDeaths( pSector );
#endif
if we look at HandleBloodCatDeaths(), it only does quest/dialog related things.
So the best place to individually decrement ubNumCreatures and ubCreaturesInBattle should probably be in ProcessQueenCmdImplicationsOfDeath() when the game checks for creature type, but currently bloodcats are excluded (intentionally?)
@silversurfer, @Flugente can you comment on this?
[Updated on: Mon, 05 August 2019 17:57]
Left this community.Report message to a moderator
|
|
|
|
![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 18:08:22 GMT+2 2025
Total time taken to generate the page: 0.00934 seconds
|