gta-reversed/gta-reversed-modern

Assert failed `CGeneral::RandomBool`

Opened this issue · 7 comments

Expected and current behavior

The game without this warning.

Additional information

Log log.log
This warning occurs here: https://github.com/gta-reversed/gta-reversed-modern/blob/master/source/game_sa/General.cpp#L169

Steps to reproduce

  1. Start Game
    1.1. New game
    1.2. Loading a save
    I don't know about others, but that's how it comes into play. Perhaps it is because of such a launch?
  2. Pick up a sawn-off shotgun and start shooting randomly

Screenshots/Videos

gta_sa_2us7K3Gpbv.mp4

Thanks for the fancy bug report. I need a stack trace though.

gta_reversed.asi!CAEAudioUtility::ResolveProbability(float p) Строка 45	C++
gta_sa.exe!004db8d8()	Нет данных
gta_reversed.asi!CAECollisionAudioEntity::ReportBulletHit(CEntity * entity, eSurfaceType surface, const CVector & posn, float angleWithColPointNorm) Строка 279	C++
gta_reversed.asi!CAudioEngine::ReportBulletHit(CEntity * entity, eSurfaceType surface, const CVector & posn, float angleWithColPointNorm) Строка 356	C++
gta_reversed.asi!CWeapon::DoBulletImpact::__l8::<lambda_1>::operator()() Строка 513	C++
gta_reversed.asi!CWeapon::DoBulletImpact(CEntity * firedBy, CEntity * victim, const CVector & startPoint, const CVector & endPoint, const CColPoint & hitCP, int incrementalHit) Строка 685	C++
gta_sa.exe!0074119e()	Нет данных
gta_reversed.asi!CWeapon::Fire::__l2::<lambda_1>::operator()() Строка 1678	C++
gta_reversed.asi!CWeapon::Fire(CEntity * firedBy, CVector * startPosn, CVector * barrelPosn, CEntity * targetEnt, CVector * targetPosn, CVector * altPosn) Строка 1608	C++
gta_reversed.asi!CTaskSimpleUseGun::FireGun::__l2::<lambda_1>::operator()(CVector origin, CVector barrelPos) Строка 91	C++
gta_reversed.asi!CTaskSimpleUseGun::FireGun(CPed * ped, bool isLeftHand) Строка 103	C++
gta_reversed.asi!CTaskSimpleUseGun::SetPedPosition(CPed * ped) Строка 555	C++
gta_reversed.asi!CPedIntelligence::ProcessAfterPreRender() Строка 598	C++
gta_reversed.asi!CWorld::ProcessPedsAfterPreRender() Строка 273	C++
gta_reversed.asi!Idle(void * param) Строка 335	C++
gta_reversed.asi!AppEventHandler(RsEvent event, void * param) Строка 107	C++
gta_reversed.asi!RsEventHandler(RsEvent event, void * param) Строка 292	C++
gta_reversed.asi!ProcessGameLogic(int nCmdShow, tagMSG & Msg) Строка 245	C++
gta_reversed.asi!MainLoop(int nCmdShow, tagMSG & Msg) Строка 271	C++```

This seems familiar for some reason.
I guess p of ResolveProbability is negative (or 0?) and that's what causes the issue.

image
image
@yukani just reminded me of this... Yeah, this needs more than a stack trace... But I don't remember being able to trace back what exactly caused the nans.

Tested it last night and coulsn't reproduce. Can you retest with master?

It's really random and hard to reproduce.
I haven't had it in a while myself either.

Actually I just remembered: It was an issue with how we used the AudioLog10 in ReportBulletHit, it wasnt OG.
I've fixed it (Not sure if the commit is in master yet)