refactor: 반환값 auto로 변경
This commit is contained in:
parent
a2b92134ce
commit
c3a7148686
1 changed files with 7 additions and 7 deletions
|
|
@ -52,9 +52,9 @@ PacketHandler::HandlePacket(std::shared_ptr<Session> session,
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case PacketID::CS_UpgradeSword: {
|
case PacketID::CS_UpgradeSword: {
|
||||||
uint32_t currentLevel = session->GetSwordLevel();
|
auto currentLevel = session->GetSwordLevel();
|
||||||
uint64_t cost = SwordLogic::GetUpgradeCost(currentLevel);
|
auto cost = SwordLogic::GetUpgradeCost(currentLevel);
|
||||||
uint64_t currentGold = session->GetGold();
|
auto currentGold = session->GetGold();
|
||||||
|
|
||||||
Protocol::SC_UpgradeResult res;
|
Protocol::SC_UpgradeResult res;
|
||||||
if (currentGold < cost) {
|
if (currentGold < cost) {
|
||||||
|
|
@ -62,7 +62,7 @@ PacketHandler::HandlePacket(std::shared_ptr<Session> session,
|
||||||
res.set_result(2);
|
res.set_result(2);
|
||||||
} else {
|
} else {
|
||||||
session->SetGold(currentGold - cost);
|
session->SetGold(currentGold - cost);
|
||||||
uint8_t result = SwordLogic::TryUpgrade(currentLevel);
|
auto result = SwordLogic::TryUpgrade(currentLevel);
|
||||||
res.set_result(result);
|
res.set_result(result);
|
||||||
|
|
||||||
// 성공
|
// 성공
|
||||||
|
|
@ -113,9 +113,9 @@ PacketHandler::HandlePacket(std::shared_ptr<Session> session,
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case PacketID::CS_SellSword: {
|
case PacketID::CS_SellSword: {
|
||||||
uint32_t currentLevel = session->GetSwordLevel();
|
auto currentLevel = session->GetSwordLevel();
|
||||||
uint64_t price = SwordLogic::GetSellPrice(currentLevel);
|
auto price = SwordLogic::GetSellPrice(currentLevel);
|
||||||
uint64_t newGold = session->GetGold() + price;
|
auto newGold = session->GetGold() + price;
|
||||||
|
|
||||||
session->SetGold(newGold);
|
session->SetGold(newGold);
|
||||||
session->SetSwordLevel(0);
|
session->SetSwordLevel(0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue