void G_EventActorFall (const Edict& ent) { G_EventAdd(G_VisToPM(ent.visflags), EV_ACTOR_MOVE, ent.number); gi.WriteByte(1); gi.WriteByte(ent.pos[0]); gi.WriteByte(ent.pos[1]); gi.WriteByte(ent.pos[2]); gi.WriteByte(makeDV(DIRECTION_FALL, ent.pos[2])); gi.WriteShort(GRAVITY); gi.WriteShort(0); G_EventEnd(); }
static void Grid_SetMoveData (pathing_t *path, const pos3_t toPos, const int c, const byte length, const int dir, const int oz, const int oc, priorityQueue_t *pqueue) { pos4_t dummy; RT_AREA_TEST_POS(path, toPos, c); RT_AREA_POS(path, toPos, c) = length; /**< Store TUs for this square. */ RT_AREA_FROM_POS(path, toPos, c) = makeDV(dir, oz); /**< Store origination information for this square. */ Vector4Set(dummy, toPos[0], toPos[1], toPos[2], c); /** @todo add heuristic for A* algorithm */ PQueuePush(pqueue, dummy, length); }
/* tests for the new dvec format */ static void testDvec (void) { short dv1 = 0x0724; CU_ASSERT_EQUAL(getDVdir(dv1), 0x07); CU_ASSERT_EQUAL(getDVflags(dv1), 0x02); CU_ASSERT_EQUAL(getDVz(dv1), 0x04); short dv2 = makeDV(6, 3); CU_ASSERT_EQUAL(dv2, 0x0603); dv2 = setDVz(dv2, 4); CU_ASSERT_EQUAL(dv2, 0x0604); }
static void Grid_SetMoveData (pathing_t *path, const pos3_t toPos, const int crouch, const byte length, const int dir, const int oldZ) { RT_AREA_TEST_POS(path, toPos, crouch); RT_AREA_POS(path, toPos, crouch) = length; /**< Store TUs for this square. */ RT_AREA_FROM_POS(path, toPos, crouch) = makeDV(dir, oldZ); /**< Store origination information for this square. */ }