Skip to content

Commit

Permalink
Merge branch 'kokekanon/all-feature-redemption' of https://github.com…
Browse files Browse the repository at this point in the history
…/kokekanon/canary3 into kokekanon/all-feature-redemption
  • Loading branch information
kokekanon committed Nov 7, 2024
2 parents c551152 + 8e939e5 commit 5b5dc84
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
4 changes: 0 additions & 4 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7179,8 +7179,6 @@ void Player::diswing() {
defaultOutfit.lookWing = 0;
}



// Auras

uint8_t Player::getLastAura() const {
Expand Down Expand Up @@ -7351,7 +7349,6 @@ void Player::disaura() {
defaultOutfit.lookAura = 0;
}


// Effects

uint8_t Player::getLastEffect() const {
Expand Down Expand Up @@ -7406,7 +7403,6 @@ bool Player::toggleEffect(bool effect) {
return false;
}


const auto &playerOutfit = Outfits::getInstance().getOutfitByLookType(getPlayer(), defaultOutfit.lookType);
if (!playerOutfit) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6132,7 +6132,7 @@ void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit, uint8_t isMoun
internalCreatureChangeOutfit(player, outfit);
}

// @ wings
// @ wings
if (outfit.lookWing != 0) {
const auto wing = attachedeffects->getWingByID(outfit.lookWing);
if (!wing) {
Expand Down
34 changes: 17 additions & 17 deletions src/lua/functions/core/game/game_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,57 +920,57 @@ int GameFunctions::luaGameGetAchievements(lua_State* L) {

int GameFunctions::getAllAttachedeffects(lua_State* L) { // delete before push
// Game.getAllAttachedeffects(type)
const std::string type = luaL_checkstring(L, 1);
const std::string type = luaL_checkstring(L, 1);

lua_newtable(L);
lua_newtable(L);

if (type == "aura") {
const auto &auras = g_game().attachedeffects->getAuras();
int index = 1;
for (const auto &aura : auras) {
lua_newtable(L);
lua_newtable(L);
lua_pushinteger(L, aura->id);
lua_setfield(L, -2, "id");
lua_pushstring(L, aura->name.c_str());
lua_pushstring(L, aura->name.c_str());
lua_setfield(L, -2, "name");
lua_rawseti(L, -2, index++);
lua_rawseti(L, -2, index++);
}
} else if (type == "wing") {
const auto &wings = g_game().attachedeffects->getWings();
int index = 1;
for (const auto &wing : wings) {
lua_newtable(L);
lua_newtable(L);
lua_pushinteger(L, wing->id);
lua_setfield(L, -2, "id");
lua_pushstring(L, wing->name.c_str());
lua_pushstring(L, wing->name.c_str());
lua_setfield(L, -2, "name");
lua_rawseti(L, -2, index++);
lua_rawseti(L, -2, index++);
}
} else if (type == "effect") {
const auto &wings = g_game().attachedeffects->getEffects();
int index = 1;
for (const auto &wing : wings) {
lua_newtable(L);
lua_pushinteger(L, wing->id);
lua_newtable(L);
lua_pushinteger(L, wing->id);
lua_setfield(L, -2, "id");
lua_pushstring(L, wing->name.c_str());
lua_pushstring(L, wing->name.c_str());
lua_setfield(L, -2, "name");
lua_rawseti(L, -2, index++);
lua_rawseti(L, -2, index++);
}
} else if (type == "shader") {
const auto &shaders = g_game().attachedeffects->getShaders();
int index = 1;
for (const auto &shader : shaders) {
lua_newtable(L);
lua_pushinteger(L, shader->id);
lua_newtable(L);
lua_pushinteger(L, shader->id);
lua_setfield(L, -2, "id");
lua_pushstring(L, shader->name.c_str());
lua_pushstring(L, shader->name.c_str());
lua_setfield(L, -2, "name");
lua_rawseti(L, -2, index++);
lua_rawseti(L, -2, index++);
}
} else {
lua_pushnil(L);
}

return 1;
return 1;
}
4 changes: 2 additions & 2 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void ProtocolGame::login(const std::string &name, uint32_t accountId, OperatingS
if (operatingSystem >= CLIENTOS_OTCLIENT_LINUX) {
isOTC = true;
if (isOTC && otclientV8 == 0) {
sendOTCRFeatures();
sendOTCRFeatures();
}
NetworkMessage opcodeMessage;
opcodeMessage.addByte(0x32);
Expand Down Expand Up @@ -9432,7 +9432,7 @@ void ProtocolGame::sendOutfitWindowCustomOTCR(NetworkMessage &msg) {
if (!isOTCR) {
return;
}
// wings
// wings
auto startWings = msg.getBufferPosition();
uint16_t limitWings = std::numeric_limits<uint16_t>::max();
uint16_t wingSize = 0;
Expand Down

0 comments on commit 5b5dc84

Please sign in to comment.