MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / notifySeatsWithVision

Method notifySeatsWithVision

source/entities/MapLight.cpp:186–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void 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
207bool MapLight::tryPickup(Seat* seat)
208{

Callers 1

Calls 2

getIsHumanMethod · 0.80
getPlayerMethod · 0.45

Tested by

no test coverage detected