Fix regression with /speed and /jump after previous change

Also changed the case values to use the client definitions.
This commit is contained in:
dongresource 2023-09-13 04:37:49 +02:00
parent c636c538eb
commit bd0cc3c212

View File

@ -69,10 +69,10 @@ static void setValuePlayer(CNSocket* sock, CNPacketData* data) {
// Handle serverside value-changes // Handle serverside value-changes
switch (setData->iSetValueType) { switch (setData->iSetValueType) {
case 1: case CN_GM_SET_VALUE_TYPE__HP:
response.iSetValue = plr->HP = setData->iSetValue; response.iSetValue = plr->HP = setData->iSetValue;
break; break;
case 2: case CN_GM_SET_VALUE_TYPE__WEAPON_BATTERY :
plr->batteryW = setData->iSetValue; plr->batteryW = setData->iSetValue;
// caps // caps
@ -81,7 +81,7 @@ static void setValuePlayer(CNSocket* sock, CNPacketData* data) {
response.iSetValue = plr->batteryW; response.iSetValue = plr->batteryW;
break; break;
case 3: case CN_GM_SET_VALUE_TYPE__NANO_BATTERY:
plr->batteryN = setData->iSetValue; plr->batteryN = setData->iSetValue;
// caps // caps
@ -90,13 +90,17 @@ static void setValuePlayer(CNSocket* sock, CNPacketData* data) {
response.iSetValue = plr->batteryN; response.iSetValue = plr->batteryN;
break; break;
case 4: case CN_GM_SET_VALUE_TYPE__FUSION_MATTER:
Missions::updateFusionMatter(sock, setData->iSetValue - plr->fusionmatter); Missions::updateFusionMatter(sock, setData->iSetValue - plr->fusionmatter);
response.iSetValue = plr->fusionmatter; response.iSetValue = plr->fusionmatter;
break; break;
case 5: case CN_GM_SET_VALUE_TYPE__CANDY:
response.iSetValue = plr->money = setData->iSetValue; response.iSetValue = plr->money = setData->iSetValue;
break; break;
case CN_GM_SET_VALUE_TYPE__SPEED:
case CN_GM_SET_VALUE_TYPE__JUMP:
response.iSetValue = setData->iSetValue;
break;
} }
response.iPC_ID = setData->iPC_ID; response.iPC_ID = setData->iPC_ID;