Commit 7d85c53e authored by gentlespoon's avatar gentlespoon Committed by Melledy
Browse files

Restrict to MP prop only.

parent 5c275c2e
......@@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PropValueOuterClass.PropValue;
import emu.grasscutter.net.proto.SetPlayerPropReqOuterClass.SetPlayerPropReq;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketSetPlayerNameRsp;
import emu.grasscutter.server.packet.send.PacketSetPlayerPropRsp;
import java.util.ArrayList;
......@@ -24,8 +23,12 @@ public class HandlerSetPlayerPropReq extends PacketHandler {
Player player = session.getPlayer();
List<PropValue> propList = req.getPropListList();
for (int i = 0; i < propList.size(); i++) {
if (!player.setProperty(PlayerProperty.getPropById(propList.get(i).getType()), (int)propList.get(i).getVal())) {
session.send(new PacketSetPlayerPropRsp(1));
PlayerProperty prop = PlayerProperty.getPropById(propList.get(i).getType());
if (prop == PlayerProperty.PROP_IS_MP_MODE_AVAILABLE) {
if (!player.setProperty(prop, (int)propList.get(i).getVal())) {
session.send(new PacketSetPlayerPropRsp(1));
return;
}
}
}
player.save();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment