zturtleman / sgfork

Automatically exported from code.google.com/p/sgfork for archive purposes. I do not maintain it. Don't report issues here.
GNU General Public License v2.0
0 stars 0 forks source link

Some Cmd_BuyItem_f improvements #81

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Overall description:
Replace all ent->client->ps to ps:
playerState_t *ps = &ent->client->ps;

And other thing is that seems that *ps (or its parts - I'm not sure) is not 
available for CGAME, so most of clauses like:
    if(!(ent->client->ps.stats[STAT_FLAGS] & SF_CANBUY) && 
g_gametype.integer >= GT_RTP){
        if(!cgame)
            trap_SendServerCommand( ent-g_entities, va("print 
\"You're not in a buy-zone!\n\""));
        return;
    }
Are not working for client while client really would like to know why he 
can't buy the thing.

Probably there are some other possible improvements (like the way how item 
is given to player), but as important ones I would like to fix the two what 
are written above.

Variables affected:
commands:
cg_buy
buy

Original issue reported on code.google.com by igorpana...@gmail.com on 18 Nov 2009 at 9:13