mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +00:00
Add battery caps for combat rewards & commands
This commit is contained in:
parent
83c378c9c2
commit
26460c0167
@ -191,6 +191,11 @@ void MobManager::giveReward(CNSocket *sock, Mob* mob) {
|
|||||||
if (rand() % 3 == 0)
|
if (rand() % 3 == 0)
|
||||||
plr->batteryW += drop.boosts;
|
plr->batteryW += drop.boosts;
|
||||||
}
|
}
|
||||||
|
// caps
|
||||||
|
if (plr->batteryW > 9999)
|
||||||
|
plr->batteryW = 9999;
|
||||||
|
if (plr->batteryN > 9999)
|
||||||
|
plr->batteryN = 9999;
|
||||||
|
|
||||||
// simple rewards
|
// simple rewards
|
||||||
reward->m_iCandy = plr->money;
|
reward->m_iCandy = plr->money;
|
||||||
|
@ -746,9 +746,15 @@ void PlayerManager::setSpecialPlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
plr->batteryW = setData->iSetValue;
|
plr->batteryW = setData->iSetValue;
|
||||||
|
// caps
|
||||||
|
if (plr->batteryW > 9999)
|
||||||
|
plr->batteryW = 9999;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
plr->batteryN = setData->iSetValue;
|
plr->batteryN = setData->iSetValue;
|
||||||
|
// caps
|
||||||
|
if (plr->batteryN > 9999)
|
||||||
|
plr->batteryN = 9999;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
plr->fusionmatter = setData->iSetValue;
|
plr->fusionmatter = setData->iSetValue;
|
||||||
|
Loading…
Reference in New Issue
Block a user