mirror of
https://github.com/id-Software/quake2-rerelease-dll.git
synced 2026-03-20 17:09:35 +01:00
Update 1 changes
This commit is contained in:
@@ -149,3 +149,40 @@ int32_t Bot_GetItemID( const char * classname ) {
|
||||
|
||||
return Item_Invalid;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Edict_ForceLookAtPoint
|
||||
================
|
||||
*/
|
||||
void Edict_ForceLookAtPoint( edict_t * edict, gvec3_cref_t point ) {
|
||||
vec3_t viewOrigin = edict->s.origin;
|
||||
if ( edict->client != nullptr ) {
|
||||
viewOrigin += edict->client->ps.viewoffset;
|
||||
}
|
||||
|
||||
const vec3_t ideal = ( point - viewOrigin ).normalized();
|
||||
|
||||
vec3_t viewAngles = vectoangles( ideal );
|
||||
if ( viewAngles.x < -180.0f ) {
|
||||
viewAngles.x = anglemod( viewAngles.x + 360.0f );
|
||||
}
|
||||
|
||||
if ( edict->client != nullptr ) {
|
||||
edict->client->ps.pmove.delta_angles = ( viewAngles - edict->client->resp.cmd_angles );
|
||||
edict->client->ps.viewangles = {};
|
||||
edict->client->v_angle = {};
|
||||
edict->s.angles = {};
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Bot_PickedUpItem
|
||||
|
||||
Check if the given bot has picked up the given item or not.
|
||||
================
|
||||
*/
|
||||
bool Bot_PickedUpItem( edict_t * bot, edict_t * item ) {
|
||||
return item->item_picked_up_by[ ( bot->s.number - 1 ) ];
|
||||
}
|
||||
@@ -6,4 +6,6 @@
|
||||
void Bot_SetWeapon( edict_t * bot, const int weaponIndex, const bool instantSwitch );
|
||||
void Bot_TriggerEdict( edict_t * bot, edict_t * edict );
|
||||
int32_t Bot_GetItemID( const char * classname );
|
||||
void Bot_UseItem( edict_t * bot, const int32_t itemID );
|
||||
void Bot_UseItem( edict_t * bot, const int32_t itemID );
|
||||
void Edict_ForceLookAtPoint( edict_t * edict, gvec3_cref_t point );
|
||||
bool Bot_PickedUpItem( edict_t * bot, edict_t * item );
|
||||
|
||||
@@ -248,9 +248,6 @@ void Item_UpdateState( edict_t * item ) {
|
||||
}
|
||||
}
|
||||
|
||||
// track who has picked us up so far...
|
||||
item->sv.pickedup_list = item->item_picked_up_by;
|
||||
|
||||
const item_id_t itemID = item->item->id;
|
||||
if ( itemID == IT_FLAG1 || itemID == IT_FLAG2 ) {
|
||||
item->sv.ent_flags |= SVFL_IS_OBJECTIVE;
|
||||
@@ -529,4 +526,4 @@ const edict_t * FindActorUnderCrosshair( const edict_t * player ) {
|
||||
}
|
||||
|
||||
return traceEnt;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user