| 184 | } |
| 185 | |
| 186 | void MapLight::notifySeatsWithVision(const std::vector<Seat*>& seats) |
| 187 | { |
| 188 | if(!mSeatsWithVisionNotified.empty()) |
| 189 | return; |
| 190 | |
| 191 | // MapLights are visible for every seat and are not removed when vision is lost |
| 192 | const std::vector<Seat*>& allSeats = getGameMap()->getSeats(); |
| 193 | // We notify seats that gain vision |
| 194 | for(Seat* seat : allSeats) |
| 195 | { |
| 196 | mSeatsWithVisionNotified.push_back(seat); |
| 197 | |
| 198 | if(seat->getPlayer() == nullptr) |
| 199 | continue; |
| 200 | if(!seat->getPlayer()->getIsHuman()) |
| 201 | continue; |
| 202 | |
| 203 | fireAddEntity(seat, false); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | bool MapLight::tryPickup(Seat* seat) |
| 208 | { |
no test coverage detected