[Quest API] Add Bot::Camp() to Perl/Lua. (#2718)

# Perl
- Add `$bot->Camp()`.
- Add `$bot->Camp(save_to_database)`.

# Lua
- Add `bot:Camp()`.
- Add `bot:Camp(save_to_database)`.

# Notes
- Saves to database by default, overload is for edge case where a user may not want bot to save to database.
This commit is contained in:
Alex King
2023-01-10 21:44:55 -05:00
committed by GitHub
parent 09d1dc6a24
commit 4df9fa89bc
5 changed files with 32 additions and 9 deletions
+5 -8
View File
@@ -7728,21 +7728,18 @@ void Bot::DoEnduranceUpkeep() {
SetEndurance(GetEndurance() - upkeep_sum);
}
void Bot::Camp(bool databaseSave) {
void Bot::Camp(bool save_to_database) {
Sit();
//auto group = GetGroup();
if(GetGroup())
if (GetGroup()) {
RemoveBotFromGroup(this, GetGroup());
// RemoveBotFromGroup() code is too complicated for this to work as-is (still needs to be addressed to prevent memory leaks)
//if (group->GroupCount() < 2)
// group->DisbandGroup();
}
LeaveHealRotationMemberPool();
if(databaseSave)
if (save_to_database) {
Save();
}
Depop();
}