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;
|
||||
|
||||
case PacketID::CS_UpgradeSword: {
|
||||
uint32_t currentLevel = session->GetSwordLevel();
|
||||
uint64_t cost = SwordLogic::GetUpgradeCost(currentLevel);
|
||||
uint64_t currentGold = session->GetGold();
|
||||
auto currentLevel = session->GetSwordLevel();
|
||||
auto cost = SwordLogic::GetUpgradeCost(currentLevel);
|
||||
auto currentGold = session->GetGold();
|
||||
|
||||
Protocol::SC_UpgradeResult res;
|
||||
if (currentGold < cost) {
|
||||
|
|
@ -62,7 +62,7 @@ PacketHandler::HandlePacket(std::shared_ptr<Session> session,
|
|||
res.set_result(2);
|
||||
} else {
|
||||
session->SetGold(currentGold - cost);
|
||||
uint8_t result = SwordLogic::TryUpgrade(currentLevel);
|
||||
auto result = SwordLogic::TryUpgrade(currentLevel);
|
||||
res.set_result(result);
|
||||
|
||||
// 성공
|
||||
|
|
@ -113,9 +113,9 @@ PacketHandler::HandlePacket(std::shared_ptr<Session> session,
|
|||
} break;
|
||||
|
||||
case PacketID::CS_SellSword: {
|
||||
uint32_t currentLevel = session->GetSwordLevel();
|
||||
uint64_t price = SwordLogic::GetSellPrice(currentLevel);
|
||||
uint64_t newGold = session->GetGold() + price;
|
||||
auto currentLevel = session->GetSwordLevel();
|
||||
auto price = SwordLogic::GetSellPrice(currentLevel);
|
||||
auto newGold = session->GetGold() + price;
|
||||
|
||||
session->SetGold(newGold);
|
||||
session->SetSwordLevel(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue