CvPlayer::DoUpdateUprisings()
- Defined in
- CvPlayer.cpp, line 11576
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_DoUpdateUprisings
Hooks
static bool BeforeCvPlayer_DoUpdateUprisings(CvPlayer* self);static void AfterCvPlayer_DoUpdateUprisings(CvPlayer* self);static void ReplaceCvPlayer_DoUpdateUprisings(void (*original)(CvPlayer*), CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_DoUpdateUprisings>(host, &BeforeCvPlayer_DoUpdateUprisings);CivRegisterAfter<CivHooks::CvPlayer_DoUpdateUprisings>(host, &AfterCvPlayer_DoUpdateUprisings);CivRegisterReplace<CivHooks::CvPlayer_DoUpdateUprisings>(host, &ReplaceCvPlayer_DoUpdateUprisings);
Code
11575/// Uprisings pop up if the empire is Very Unhappy11576void CvPlayer::DoUpdateUprisings()11577{11578 if(IsEmpireVeryUnhappy())11579 {11580 // If we're very unhappy, make the counter wind down11581 if(GetUprisingCounter() > 0)11582 {11583 ChangeUprisingCounter(-1);1158411585 // Time's up!11586 if(GetUprisingCounter() == 0)11587 {11588 DoUprising();11589 DoResetUprisingCounter(/*bFirstTime*/ false);11590 }11591 }11592 // Very Unhappy for the first time - seed the counter11593 else11594 {11595 DoResetUprisingCounter(/*bFirstTime*/ true);11596 }11597 }11598}