player->input.dobuild=false;// handle the input. if didn't do this, after destruction of hovered box, would try to build on its grid with grid_index...
player->input.dobuild=false;// handle the input. if didn't do this, after destruction of hovered box, would try to build on its grid with grid_index...
cpPointQueryInfoinfo={0};
cpPointQueryInfoinfo={0};
V2world_build=player->input.hand_pos;
V2world_build=world_hand_pos;
// @Robust sanitize this input so player can't build on any grid in the world
// @Robust sanitize this input so player can't build on any grid in the world
@ -98,7 +98,7 @@ static bool entityids_same(EntityID a, EntityID b)
// when updated, must update serialization, AND comparison
// when updated, must update serialization, AND comparison
// function in main.c
// function in main.c
structInputFrame
typedefstruct
{
{
uint64_ttick;
uint64_ttick;
size_tid;// each input has unique, incrementing, I.D, so server doesn't double process inputs. Inputs to server should be ordered from 0-max like biggest id-smallest. This is done so if packet loss server still processes input
size_tid;// each input has unique, incrementing, I.D, so server doesn't double process inputs. Inputs to server should be ordered from 0-max like biggest id-smallest. This is done so if packet loss server still processes input
@ -106,13 +106,13 @@ struct InputFrame
boolseat_action;
boolseat_action;
EntityIDseat_to_inhabit;
EntityIDseat_to_inhabit;
V2hand_pos;// world coords, world star!
V2hand_pos;
EntityIDgrid_hand_pos_local_to;// when not null, hand_pos is local to this grid. this prevents bug where
booldobuild;
booldobuild;
enumBoxTypebuild_type;
enumBoxTypebuild_type;
enumCompassRotationbuild_rotation;
enumCompassRotationbuild_rotation;
EntityIDgrid_to_build_on;
}InputFrame;
};
typedefstructEntity
typedefstructEntity
{
{
@ -158,7 +158,7 @@ typedef struct Player
{
{
boolconnected;
boolconnected;
EntityIDentity;
EntityIDentity;
structInputFrameinput;
InputFrameinput;
}Player;
}Player;
// gotta update the serialization functions when this changes
// gotta update the serialization functions when this changes