BattleData can hold a limited number of characters
This commit is contained in:
@@ -207,6 +207,8 @@ void RoomData::RunFrameCharacterBarrierCollisions() {
|
||||
|
||||
//move the character to the battle screen
|
||||
if (characterBox.CheckOverlap(barrierBox)) {
|
||||
//TODO: (0) What if the barrier is full?
|
||||
//TODO: (0) What if the player logs in on top of a barrier?
|
||||
//pump character unload
|
||||
CharacterPacket charPacket;
|
||||
charPacket.type = SerialPacketType::CHARACTER_UNLOAD;
|
||||
@@ -293,6 +295,13 @@ void RoomData::PopCharacter(CharacterData const * const character) {
|
||||
}
|
||||
}
|
||||
|
||||
//check the battles to see if the character isn't there
|
||||
for (auto& it : *battleMgr.GetContainer()) {
|
||||
if (it.second.PopCharacter(character)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
throw(std::logic_error("cannot remove a non-existant instance of CharacterData in RoomData"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user