I'm working on the BAM mapvote mod and have added a maplist command.
So far I have 200 maps in a maplist.qc generated by a bash script. I've also integrated a MOTD feature. I'll release this as soon as I can fix the following problem:
The is my function to list maps in the console:
This is how it's called:
As you can see I reset self.impulse to stop any runaway loops. VOTE_MAPLIST is set to 222 and I have a 'maplist' alias set to impulse 222.
Pretty simple stuff. The problem is that it generates a runaway loop error and I can't see why. I've also tried a while loop, but that has the same problem. VOTE_NUMMAPS is set to 200. While testing in the early stages I found that it would go to 231 maps, but 200 is a nice round number.
Error:
While trying to debug it I've changed "sprint (self, number_to_map(i));" to just print "xxxx " to see if number_to_map() is a problem, but same bug occurs.
Any ideas?
So far I have 200 maps in a maplist.qc generated by a bash script. I've also integrated a MOTD feature. I'll release this as soon as I can fix the following problem:
The is my function to list maps in the console:
Code:
void() list_maps= { local int i, x; for (i=0; i<VOTE_NUMMAPS; i++) { sprint (self, number_to_map(i)); sprint (self, " "); x++; // 10 columns if (x > 10) { sprint(self, "\n"); x = 0; } } };
Code:
if (self.impulse == VOTE_MAPLIST) { list_maps(); self.impulse = 0; return; }
Pretty simple stuff. The problem is that it generates a runaway loop error and I can't see why. I've also tried a while loop, but that has the same problem. VOTE_NUMMAPS is set to 200. While testing in the early stages I found that it would go to 231 maps, but 200 is a nice round number.
Error:
Code:
SZ_GetSpace: overflow server Profile: [CallCount] [Statement] [BuiltinCt] [StmtTotal] [BltnTotal] [self] Host_Error: server runaway loop counter hit limit of 10000000 jumps tip: read above for list of most-executed functions QuakeC crash report for server: s4667: EQ_F (=0), GLOBAL1689, GLOBAL511 s4668: IFNOT GLOBAL511, statement 4671 s4669: RETURN GLOBAL1688 s4670: GOTO , statement 4730 s4671: EQ_F (=0), GLOBAL1691, GLOBAL511 s4672: IFNOT GLOBAL511, statement 4675 s4673: RETURN GLOBAL1690 s4674: GOTO , statement 4730 PRVM_GetString: Invalid constant-string offset (4698400 >= 43652 prog->stringssize) : number_to_map : statement 743 PRVM_GetString: Invalid constant-string offset (4759096 >= 43652 prog->stringssize) : list_maps : statement 4 PRVM_GetString: Invalid constant-string offset (4759096 >= 43652 prog->stringssize) : vote_init_consider : statement 13 PRVM_GetString: Invalid constant-string offset (4800712 >= 43652 prog->stringssize) : W_WeaponFrame : statement 23 PRVM_GetString: Invalid constant-string offset (4940144 >= 43652 prog->stringssize) : PlayerPostThink : statement 7 Client "Slacker" dropped Slacker left the game with 0 frags Quake Error: Host_Error: server runaway loop counter hit limit of 10000000 jumps tip: read above for list of most-executed functions
Any ideas?
Comment