Fix LSL validation errors in Bot_Manager, Controller_Memory, Player_RegistrationManager, and Floater_Manager

- Bot_Manager.lsl: Fixed 3 variable name conflicts (response, botIdx, botLives)
- Controller_Memory.lsl: Fixed 2 variable name conflicts (usedMemory, memoryPercentage)
- Player_RegistrationManager.lsl: Fixed 1 variable name conflict (i)
- Floater_Manager.lsl: Fixed 1 variable name conflict (i)
- Progress: 115 → 108 total errors (-7)
This commit is contained in:
RebeccaNod1 2025-09-18 12:26:14 -05:00
parent 4b3adf32a2
commit 7e8de1cc01
4 changed files with 18 additions and 18 deletions

View file

@ -126,8 +126,8 @@ doBotPick(string botName, integer count, integer diceMax, list avoidNumbers) {
} else { } else {
llOwnerSay("[Bot Manager] ❌ " + botName + " cannot pick any numbers - all " + (string)diceMax + " numbers are taken!"); llOwnerSay("[Bot Manager] ❌ " + botName + " cannot pick any numbers - all " + (string)diceMax + " numbers are taken!");
// Still send empty response to prevent game hanging // Still send empty response to prevent game hanging
string response = "BOT_PICKED:" + botName + ":"; string emptyResponse = "BOT_PICKED:" + botName + ":";
llMessageLinked(LINK_SET, -9997, response, NULL_KEY); llMessageLinked(LINK_SET, -9997, emptyResponse, NULL_KEY);
return; return;
} }
} }
@ -183,15 +183,15 @@ doBotPick(string botName, integer count, integer diceMax, list avoidNumbers) {
// Helper to respond to peril roll commands // Helper to respond to peril roll commands
doBotRoll(string botName, integer diceMax) { doBotRoll(string botName, integer diceMax) {
// Validate bot exists and is still alive // Validate bot exists and is still alive
integer botIdx = llListFindList(names, [botName]); integer rollBotIdx = llListFindList(names, [botName]);
if (botIdx == -1) { if (rollBotIdx == -1) {
llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' not found in game - ignoring roll command"); llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' not found in game - ignoring roll command");
return; return;
} }
integer botLives = llList2Integer(lives, botIdx); integer rollBotLives = llList2Integer(lives, rollBotIdx);
if (botLives <= 0) { if (rollBotLives <= 0) {
llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' is eliminated (lives=" + (string)botLives + ") - ignoring roll command"); llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' is eliminated (lives=" + (string)rollBotLives + ") - ignoring roll command");
return; return;
} }

View file

@ -68,16 +68,16 @@ emergencyMemoryCleanup() {
} }
reportMemoryStats() { reportMemoryStats() {
integer usedMemory = llGetUsedMemory(); integer statsUsedMemory = llGetUsedMemory();
float memoryPercentage = (float)usedMemory / 65536.0; float statsMemoryPercentage = (float)statsUsedMemory / 65536.0;
llOwnerSay("📊 [Memory Monitor] Memory Monitor Stats:"); llOwnerSay("📊 [Memory Monitor] Memory Monitor Stats:");
llOwnerSay(" Helper Memory Used: " + (string)usedMemory + " bytes (" + llOwnerSay(" Helper Memory Used: " + (string)statsUsedMemory + " bytes (" +
(string)llRound(memoryPercentage * 100.0) + "% of 64KB)"); (string)llRound(statsMemoryPercentage * 100.0) + "% of 64KB)");
string memoryStatus; string memoryStatus;
if (memoryPercentage > MEMORY_CRITICAL_THRESHOLD) { if (statsMemoryPercentage > MEMORY_CRITICAL_THRESHOLD) {
memoryStatus = "CRITICAL"; memoryStatus = "CRITICAL";
} else if (memoryPercentage > MEMORY_WARNING_THRESHOLD) { } else if (statsMemoryPercentage > MEMORY_WARNING_THRESHOLD) {
memoryStatus = "WARNING"; memoryStatus = "WARNING";
} else { } else {
memoryStatus = "NORMAL"; memoryStatus = "NORMAL";

View file

@ -193,8 +193,8 @@ list getPicksFor(string nameInput) {
// Converts a player's key into their name (if registered) // Converts a player's key into their name (if registered)
string getNameFromKey(key id) { string getNameFromKey(key id) {
integer i = llListFindList(alivePlayers, [id]); integer idx = llListFindList(alivePlayers, [id]);
if (i != -1) return llList2String(aliveNames, i); if (idx != -1) return llList2String(aliveNames, idx);
return (string)id; return (string)id;
} }

View file

@ -142,9 +142,9 @@ handlePlayerRegistration(string regData, key requesterId) {
} else { } else {
// Build lives string dynamically // Build lives string dynamically
string livesStr = ""; string livesStr = "";
integer i; integer j;
for (i = 0; i < llGetListLength(names); i++) { for (j = 0; j < llGetListLength(names); j++) {
if (i > 0) livesStr += ","; if (j > 0) livesStr += ",";
livesStr += "3"; // Everyone starts with 3 lives livesStr += "3"; // Everyone starts with 3 lives
} }
syncMessage = livesStr + "~EMPTY~NONE~" + llList2CSV(names); syncMessage = livesStr + "~EMPTY~NONE~" + llList2CSV(names);