All pastes #719338 Raw Edit

Supaosa

public text v1 · immutable
#719338 ·published 2007-09-29 05:47 UTC
rendered paste body
        // Send to all players of the same guild
		// NOTE: plr is the guild leader OR replace plr->GetGuildId() with the specific ID of the guild
		Player * thisPlr;
        objmgr._playerslock.AcquireReadLock();
        HM_NAMESPACE::hash_map<uint32, Player*>::const_iterator itr;

        for (itr = objmgr._players.begin(); itr != objmgr._players.end(); itr++)
        {
            thisPlr = itr->second;
				if( thisPlr->GetGuildId() == plr->GetGuildId() )
				{
				// Same Faction
				Item * item = objmgr.CreateItem( 99999 , thisPlr );
				thisPlr->GetItemInterface()->AddItemToFreeSlot( item );
				}
        }
        objmgr._playerslock.ReleaseReadLock();