(WIP) EXPERIMENTAL GROUP CHANGES

This commit is contained in:
gsemaj
2022-04-22 21:13:00 -04:00
parent 0a2b3fbdad
commit 71e78afa0b
10 changed files with 176 additions and 155 deletions

View File

@@ -260,11 +260,10 @@ void Combat::npcAttackPc(Mob *mob, time_t currTime) {
* set of rolls.
*/
void Combat::genQItemRolls(Player *leader, std::map<int, int>& rolls) {
for (int i = 0; i < leader->groupCnt; i++) {
if (leader->groupIDs[i] == 0)
continue;
auto players = (*leader->group)[EntityKind::PLAYER];
for (int i = 0; i < players.size(); i++) {
CNSocket *otherSock = PlayerManager::getSockFromID(leader->groupIDs[i]);
CNSocket *otherSock = players[i].sock;
if (otherSock == nullptr)
continue;
@@ -670,7 +669,7 @@ static void playerTick(CNServer *serv, time_t currTime) {
bool transmit = false;
// group ticks
if (plr->groupCnt > 1)
if (plr->group != nullptr)
Groups::groupTickInfo(plr);
// do not tick dead players