Unfortunately, I haven't yet realized how to build Knights from sources on Windows, so I can't check my suspicion, but:
in
src\engine\impl\player.cppfunction
bool Player::respawn() looks like this:
____
{
if (
!respawn_func.hasValue() && getRespawnType() != R_RANDOM_SQUARE && (!home_dmap || home_location.isNull())) {
if (!already_eliminated) {
//----BRANCH 1---- //SEND "Player X eliminated" message and execute
mediator.eliminatePlayer(*this); }
return true; // this counts as a "success" -- we do not want the respawn task to keep retrying.
}
// Find out where we should respawn
if (!respawn_map || respawn_point.isNull())
return false;
//----BRANCH 2---- // Respawn successful -- Create a new knight.
//----BRANCH 3---- return true;
}
____
So the Branch 1 (which is responsible for "eliminated" messages) can be reached only if there is no lua respawn function set.
Otherwise, if the respawn_func is set and there is no spawn points left, BRANCH 2 will be executed (just return false without any other actions).
Does that mean what it will keep trying to respawn a player later without any success?
void RespawnTask::execute(TaskManager &tm)
{
if (this != player.respawn_task.get()) return;
bool success = player.respawn();
if (!success) {
tm.addTask(shared_from_this(), TP_NORMAL, tm.getGVT() + 100); // try again later
}
}
IMHO, on the one hand - that would mean what any lua respawn function should somehow detect this situation and call kts.EliminatePlayer() manually (even if it was used just to detect knight respawn event and it always returns nil). On the other hand - I'm not sure how lua function can check whether there are any more spawn points left (haven't used lua for a long time)