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};
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
@ -98,7 +98,7 @@ static bool entityids_same(EntityID a, EntityID b)
// when updated, must update serialization, AND comparison
// function in main.c
structInputFrame
typedefstruct
{
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
@ -106,13 +106,13 @@ struct InputFrame
boolseat_action;
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;
enumBoxTypebuild_type;
enumCompassRotationbuild_rotation;
EntityIDgrid_to_build_on;
};
}InputFrame;
typedefstructEntity
{
@ -158,7 +158,7 @@ typedef struct Player
{
boolconnected;
EntityIDentity;
structInputFrameinput;
InputFrameinput;
}Player;
// gotta update the serialization functions when this changes