Skip to content

Commit

Permalink
Maniac Patch : Fix String Vars with ShowPicture
Browse files Browse the repository at this point in the history
Added the following:
- Check if we're using a string variable with com.parameters[17]
- Set the name parameter to the String Variable

Fixed the following:
- When using a String Var with ShowPicture, it no longers crash the game with picture ID -1
  • Loading branch information
ToolMan2k authored and Ghabry committed Mar 11, 2024
1 parent 5378b3b commit f31a636
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,12 @@ bool Game_Interpreter::CommandShowPicture(lcf::rpg::EventCommand const& com) { /

if (param_size > 16 && (Player::IsRPG2k3ECommands() || Player::IsPatchManiac())) {
// Handling of RPG2k3 1.12 chunks
pic_id = ValueOrVariable(com.parameters[17], pic_id);
if (Player::IsPatchManiac()) {
pic_id = ValueOrVariableBitfield(com.parameters[17], 0, pic_id);
params.name = ToString(CommandStringOrVariableBitfield(com, 17, 2, 30));
} else {
pic_id = ValueOrVariable(com.parameters[17], pic_id);
}
if (com.parameters[19] != 0) {
int var = 0;
if (Main_Data::game_variables->IsValid(com.parameters[19])) {
Expand Down

0 comments on commit f31a636

Please sign in to comment.