236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
void
moveplayer(dynent *pl, int moveres, bool local, int curtime)
{
const bool water = hdr.waterlevel > pl->o.z - 0.5f;
const bool floating = (editmode && local) || pl->state == CS_EDITING;
vec d; // vector of direction we ideally want to move in
d.x = (float)(pl->move * cos(rad(pl->yaw - 90)));
d.y = (float)(pl->move * sin(rad(pl->yaw - 90)));
d.z = 0;
if (floating || water) {
d.x *= (float)cos(rad(pl->pitch));
|
|
|
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
void
moveplayer(dynent *pl, int moveres, bool local, int curtime)
{
const bool water = hdr.waterlevel > pl->o.z - 0.5f;
const bool floating = (editmode && local) || pl->state == CS_EDITING;
OFVector3D d; // vector of direction we ideally want to move in
d.x = (float)(pl->move * cos(rad(pl->yaw - 90)));
d.y = (float)(pl->move * sin(rad(pl->yaw - 90)));
d.z = 0;
if (floating || water) {
d.x *= (float)cos(rad(pl->pitch));
|