mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-30 04:20:06 +00:00
Refactor player groups
Group structures are used now. Adds more checks in some places but simplifies things overall. We can expand this system to entities as well now pretty trivially.
This commit is contained in:
@@ -259,16 +259,10 @@ void Combat::npcAttackPc(Mob *mob, time_t currTime) {
|
||||
* single RNG roll per mission task, and every group member shares that same
|
||||
* set of rolls.
|
||||
*/
|
||||
void Combat::genQItemRolls(Player *leader, std::map<int, int>& rolls) {
|
||||
auto players = (*leader->group)[EntityKind::PLAYER];
|
||||
void Combat::genQItemRolls(std::vector<Player*> players, std::map<int, int>& rolls) {
|
||||
for (int i = 0; i < players.size(); i++) {
|
||||
|
||||
CNSocket *otherSock = players[i].sock;
|
||||
if (otherSock == nullptr)
|
||||
continue;
|
||||
|
||||
Player *member = PlayerManager::getPlayer(otherSock);
|
||||
|
||||
Player* member = players[i];
|
||||
for (int j = 0; j < ACTIVE_MISSION_COUNT; j++)
|
||||
if (member->tasks[j] != 0)
|
||||
rolls[member->tasks[j]] = Rand::rand();
|
||||
|
||||
Reference in New Issue
Block a user