Jump to content

How to disable spectating a bot?


Go to solution Solved by barry0033,

Recommended Posts

Hi!

Does anyone know how I could disable spectating a bot? (such as that using cmds /follow <clientnumber> or /follownext wouldn't allow SPECTATOR FOLLOW on the bot; following humanplayers should then still remain functional though).

If so, could they shed some light on this?

I've searched a lot of open-source q3 mods and forums for this, but yet haven't found the answer..

Is it perhaps simply in g_active.c "SpectatorClientEndFrame" section?


I'm asking this because I'm making a 'boss'-fight map, with the bot remaining in a 'hidden' area icon17.gif

The Goal I want to achieve: make it impossible to spectate bots

Thanks!!
Link to comment
  • Solution

Ok, so if anyone is interested in knowing, just add (the lines marked in yellow) this to g_cmds.c:

 

 

----------------------------------------------------------------------

/*
=================
Cmd_FollowCycle_f
=================
*/
void Cmd_FollowCycle_f( gentity_t *ent, int dir ) {
    int        clientnum;
    int        original;
    qboolean    isBot;

 

...

 

        // can't follow bots
        if (!isBot) {
        return;
        }

        
        // can't follow another spectator
        if ( level.clients[ clientnum ].sess.sessionTeam == TEAM_SPECTATOR ) {
            continue;
        }

--------------------------------------------------------------------------------------------------

Bart likes this
Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...