@@ -58,11 +58,19 @@ HOOK_STATIC(Isaac, GetBuiltInCallbackState, (const int callbackid)-> bool, __cde
5858// MC_POST_TRIGGER_COLLECTIBLE_ADDED (1053)
5959// (Runs for normal items, wisps, and innate collectibles)
6060void CustomCallbacks::TriggerCollectibleAdded (Entity_Player& player, int collectibleID, bool firsttime, bool wispOrInnate) {
61- // Fixes a minor bug where the effect/costume for the charge being ready may not trigger.
62- if (wispOrInnate && collectibleID == COLLECTIBLE_MARS ) {
63- player._marsCooldown = 0 ;
64- player._marsUnk2 = -1 ;
65- player._marsUnkBool = true ;
61+ if (wispOrInnate) {
62+ switch (collectibleID) {
63+ // Fixes a minor bug where the effect/costume for the charge being ready may not trigger.
64+ case COLLECTIBLE_MARS :
65+ player._marsCooldown = 0 ;
66+ player._marsUnk2 = -1 ;
67+ player._marsUnkBool = true ;
68+ break ;
69+ // Properly updates the active hud stuff.
70+ case COLLECTIBLE_BOOK_OF_VIRTUES :
71+ player.UpdateBookOfVirtues (true );
72+ break ;
73+ }
6674 }
6775
6876 const int callbackid = 1053 ;
@@ -3024,6 +3032,16 @@ HOOK_METHOD(Entity_Player, TriggerCollectibleRemoved, (int collectibleID) -> voi
30243032 this ->RemoveCostume (g_Manager->GetItemConfig ()->GetNullItem (58 ));
30253033 }
30263034
3035+ // Properly updates the active hud stuff.
3036+ if (collectibleID == COLLECTIBLE_BOOK_OF_VIRTUES && wispOrInnate) {
3037+ auto * activeDesc = this ->GetActiveItemDesc (0 );
3038+ if (activeDesc->_item == COLLECTIBLE_BOOK_OF_VIRTUES ) {
3039+ activeDesc->_item = COLLECTIBLE_NULL ;
3040+ activeDesc->_batteryCharge = 0 ;
3041+ }
3042+ this ->UpdateBookOfVirtues (false );
3043+ }
3044+
30273045 super (collectibleID);
30283046
30293047 const int callbackid = 1095 ;
0 commit comments