Skip to content

Commit

Permalink
fix: outfit offset
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Jun 26, 2024
1 parent f0f897d commit 690c731
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,13 @@ bool GraphicManager::loadOutfitSpriteMetadata(canary::protobuf::appearances::App
sType->minimap_color = outfit.flags().has_automap() ? static_cast<uint16_t>(outfit.flags().automap().color()) : 0;
sType->draw_height = outfit.flags().has_height() ? static_cast<uint16_t>(outfit.flags().height().elevation()) : 0;
if (outfit.flags().has_shift()) {
auto drawOffset = sType->getDrawOffset();
drawOffset.x -= outfit.flags().shift().x();
drawOffset.y -= outfit.flags().shift().y();
sType->isDrawOffsetLoaded = true;
wxPoint drawOffset(0, 0);
if (sType->width > 32 || sType->height > 32) {
drawOffset = sType->getDrawOffset();
}
drawOffset.x += outfit.flags().shift().x();
drawOffset.y += outfit.flags().shift().y();
sType->draw_offset = drawOffset;
}

// Read the sprite ids
Expand Down

0 comments on commit 690c731

Please sign in to comment.