Skip to content

Commit

Permalink
TWEAH: Player Life Meter now trigger when player in grotto and when t…
Browse files Browse the repository at this point in the history
…he save file is valid
  • Loading branch information
PurpleHato committed Sep 6, 2023
1 parent 48b8f4b commit 5342032
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,11 @@ const ImVec4 GREEN = ImVec4(0.5f, 1.0f, 0.5f, 1.0f);

bool heartTexturesLoaded = false;

bool IsValidSave() {
bool validSave = gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2;
return validSave;
}

const char* heartTextureNames[16] = {
"Heart_Full", "Heart_One_Fourth", "Heart_One_Fourth", "Heart_One_Fourth",
"Heart_One_Fourth", "Heart_One_Fourth", "Heart_Half", "Heart_Half",
Expand Down Expand Up @@ -1034,7 +1039,7 @@ void AnchorPlayerLocationWindow::DrawElement() {
}
ImGui::PopStyleVar();
}
if (gPlayState != NULL && client.scene != SCENE_GROTTOS && client.scene != SCENE_ID_MAX && CVarGetInteger("gAnchorPlayerHealth", 0) != 0) {
if (IsValidSave() && CVarGetInteger("gAnchorPlayerHealth", 0) != 0) {
DisplayLifeMeter(client);
}
}
Expand Down

0 comments on commit 5342032

Please sign in to comment.