Skip to content

Commit

Permalink
Merge pull request #876 from WALLOFJUSTICE/dev23-q4
Browse files Browse the repository at this point in the history
* hotfixes
  • Loading branch information
WALLOFJUSTICE authored Feb 8, 2025
2 parents 2baf1ea + aa25a7e commit dd59e1d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
24 changes: 23 additions & 1 deletion src/interface/drawstatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2909,59 +2909,70 @@ void drawStatusNew(const int player)
{
// if hotbar_numkey_quick_add is enabled, then the number keys won't do the default equip function
// skips equipping items if the mouse is in the hotbar or inventory area. otherwise the below code runs.

bool pressed = false;
if ( Input::inputs[player].binaryToggle("Hotbar Slot 1") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 1");
item = uidToItem(hotbar[0].item);
hotbar_t.current_hotbar = 0;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 2") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 2");
item = uidToItem(hotbar[1].item);
hotbar_t.current_hotbar = 1;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 3") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 3");
item = uidToItem(hotbar[2].item);
hotbar_t.current_hotbar = 2;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 4") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 4");
item = uidToItem(hotbar[3].item);
hotbar_t.current_hotbar = 3;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 5") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 5");
item = uidToItem(hotbar[4].item);
hotbar_t.current_hotbar = 4;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 6") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 6");
item = uidToItem(hotbar[5].item);
hotbar_t.current_hotbar = 5;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 7") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 7");
item = uidToItem(hotbar[6].item);
hotbar_t.current_hotbar = 6;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 8") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 8");
item = uidToItem(hotbar[7].item);
hotbar_t.current_hotbar = 7;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 9") )
{
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 9");
item = uidToItem(hotbar[8].item);
hotbar_t.current_hotbar = 8;
pressed = true;
}
if ( Input::inputs[player].binaryToggle("Hotbar Slot 10")
&& hotbar_t.getHotbarSlotFrame(9)
Expand All @@ -2970,6 +2981,17 @@ void drawStatusNew(const int player)
Input::inputs[player].consumeBinaryToggle("Hotbar Slot 10");
item = uidToItem(hotbar[9].item);
hotbar_t.current_hotbar = 9;
pressed = true;
}

// quickcasting spells
if ( pressed && item && itemCategory(item) == SPELL_CAT )
{
spell_t* spell = getSpellFromItem(player, item, true);
if ( spell && players[player]->magic.selectedSpell() == spell )
{
players[player]->hotbar.faceMenuQuickCast = true;
}
}
}

Expand Down Expand Up @@ -3089,7 +3111,7 @@ void drawStatusNew(const int player)
// quickcasting spells
if (item && itemCategory(item) == SPELL_CAT )
{
spell_t* spell = getSpellFromItem(player, item, false);
spell_t* spell = getSpellFromItem(player, item, true);
if ( spell && players[player]->magic.selectedSpell() == spell )
{
players[player]->hotbar.faceMenuQuickCast = true;
Expand Down
24 changes: 12 additions & 12 deletions src/mod_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17226,9 +17226,9 @@ std::vector<Sint32> Compendium_t::CompendiumMonsters_t::Monster_t::getDisplaySta
statMax = hp[1];
}

int statIncrease = ((abs(statMin) / 20) * 20);
int statIncrease = ((abs(statMin) / 20 + 1) * 20);
statMin += statIncrease - (statIncrease / 5);
statIncrease = ((abs(statMax) / 20) * 20);
statIncrease = ((abs(statMax) / 20 + 1) * 20);
statMax += statIncrease;
retVal.push_back(statMin);
if ( statMax != statMin )
Expand All @@ -17252,9 +17252,9 @@ std::vector<Sint32> Compendium_t::CompendiumMonsters_t::Monster_t::getDisplaySta
statMax = spd[1];
}

int statIncrease = std::min((abs(statMin) / 4) * 1, 8);
int statIncrease = std::min((abs(statMin) / 4 + 1) * 1, 8);
statMin += statIncrease - (statIncrease / 2);
statIncrease = std::min((abs(statMax) / 4) * 1, 8);
statIncrease = std::min((abs(statMax) / 4 + 1) * 1, 8);
statMax += statIncrease;
retVal.push_back(statMin);
if ( statMax != statMin )
Expand Down Expand Up @@ -17285,9 +17285,9 @@ std::vector<Sint32> Compendium_t::CompendiumMonsters_t::Monster_t::getDisplaySta
}
}

int statIncrease = (abs(statMin) / 5) * 1;
int statIncrease = (abs(statMin) / 5 + 1) * 1;
int minIncrease = statIncrease - (statIncrease / 2);
statIncrease = (abs(statMax) / 5) * 1;
statIncrease = (abs(statMax) / 5 + 1) * 1;
int maxIncrease = statIncrease;

if ( ac.size() > 0 )
Expand Down Expand Up @@ -17331,9 +17331,9 @@ std::vector<Sint32> Compendium_t::CompendiumMonsters_t::Monster_t::getDisplaySta
}
}

int statIncrease = (abs(statMin) / 5) * 5;
int statIncrease = (abs(statMin) / 5 + 1) * 5;
int minIncrease = statIncrease - (statIncrease / 4);
statIncrease = (abs(statMax) / 5) * 5;
statIncrease = (abs(statMax) / 5 + 1) * 5;
int maxIncrease = statIncrease;

if ( atk.size() > 0 )
Expand Down Expand Up @@ -17368,9 +17368,9 @@ std::vector<Sint32> Compendium_t::CompendiumMonsters_t::Monster_t::getDisplaySta
{
Sint32 statMinDEX = stats.DEX;
Sint32 statMaxDEX = stats.DEX + stats.RANDOM_DEX;
int statIncrease = std::min((abs(statMinDEX) / 4) * 1, 8);
int statIncrease = std::min((abs(statMinDEX) / 4 + 1) * 1, 8);
int minIncrease = (statIncrease / 2);
statIncrease = std::min((abs(statMaxDEX) / 4) * 1, 8);
statIncrease = std::min((abs(statMaxDEX) / 4 + 1) * 1, 8);
int maxIncrease = statIncrease;

statMinIncrease += minIncrease;
Expand All @@ -17379,9 +17379,9 @@ std::vector<Sint32> Compendium_t::CompendiumMonsters_t::Monster_t::getDisplaySta
{
Sint32 statMinPER = stats.PER;
Sint32 statMaxPER = stats.PER + stats.RANDOM_PER;
int statIncrease = (abs(statMinPER) / 5) * 5;
int statIncrease = (abs(statMinPER) / 5 + 1) * 5;
int minIncrease = statIncrease - (statIncrease / 4);
statIncrease = (abs(statMaxPER) / 5) * 5;
statIncrease = (abs(statMaxPER) / 5 + 1) * 5;
int maxIncrease = statIncrease;

statMinIncrease += minIncrease;
Expand Down

0 comments on commit dd59e1d

Please sign in to comment.