1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-11 08:15:35 +03:00

Exclude player caller from packet's fields (#7368)

This commit is contained in:
Skat 2022-08-15 15:25:12 +04:00 committed by GitHub
parent fe1d81b4d5
commit 9e9ef56fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,13 @@ public class CallGenerator{
register.addStatement("mindustry.net.Net.registerPacket($L.$L::new)", packageName, ent.packetClassName);
//add fields to the type
for(Svar param : ent.element.params()){
Seq<Svar> params = ent.element.params();
for(int i = 0; i < params.size; i++){
if(!ent.where.isServer && i == 0){
continue;
}
Svar param = params.get(i);
packet.addField(param.tname(), param.name(), Modifier.PUBLIC);
}