Skip to content

Commit ee3299e

Browse files
committed
Fix a crash
1 parent b0f34ef commit ee3299e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"gd": {
44
"win": "2.206"
55
},
6-
"version": "v0.8.2",
6+
"version": "v0.8.3",
77
"id": "zalphalaneous.minecraft",
88
"name": "Minecraftify!",
99
"developer": "Alphalaneous",

src/ui/hooks/PlayLayer.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ class $modify(MyPlayLayer, PlayLayer){
107107

108108
schedule(schedule_selector(MyPlayLayer::setFPS), 1);
109109

110+
if(CCLabelBMFont* debugText = typeinfo_cast<CCLabelBMFont*>(getChildByID("debug-text"))) {
111+
if(strcmp(debugText->getString(), "Ignore Damage") == 0){
112+
debugText = typeinfo_cast<CCLabelBMFont*>(getChildByID("percentage-label")); //hacky fix for wrong node IDs
113+
}
114+
debugText->setOpacity(0);
115+
}
116+
110117
return true;
111118
}
112119

@@ -115,6 +122,10 @@ class $modify(MyPlayLayer, PlayLayer){
115122
m_fields->rightDebugNode->removeAllChildren();
116123

117124
if(CCLabelBMFont* debugText = typeinfo_cast<CCLabelBMFont*>(getChildByID("debug-text"))) {
125+
if(strcmp(debugText->getString(), "Ignore Damage") == 0){
126+
debugText = typeinfo_cast<CCLabelBMFont*>(getChildByID("percentage-label")); //hacky fix for wrong node IDs
127+
}
128+
118129
if(!debugText->isVisible()) return;
119130

120131
debugText->setOpacity(0);

0 commit comments

Comments
 (0)