mob/proc/nextturn() movedon = 0 if(src.contents.len <= 5) src.drawcard() for(var/mob/M in world) M.onus = 0 for(var/obj/nnine/A in M) M.onus += 1 if(dplay == 1) world << "[usr] must play again!" dplay = 0 movedon = 1 return if(currentturn == 1) if(el2 == 1) movedon = 1 src.nextturn() return if(movedon == 0 && el2 == 0) world << "The pile is now at [points] point\s" world << "It is now [player2]'s turn." currentturn = 2 movedon = 1 if(currentturn == 2) if(el3 == 1) movedon = 1 src.nextturn() return if(movedon == 0 && el3 == 0) world << "The pile is now at [points] point\s" world << "It is now [player3]'s turn." currentturn = 3 movedon = 1 if(currentturn == 3) if(el4 == 1) movedon = 1 src.nextturn() return if(movedon == 0 && el4 == 0) world << "The pile is now at [points] point\s" world << "It is now [player4]'s turn." currentturn = 4 movedon = 1 if(currentturn == 4) if(el1 == 1) movedon = 1 src.nextturn() return if(movedon == 0 && el1 == 0) world << "The pile is now at [points] point\s" world << "It is now [player1]'s turn." currentturn = 1 movedon = 1
[EDIT] Erm, I dun see why it goes into red. [/EDIT]
ID:148583
Dec 24 2002, 10:12 pm
|
|
Whenever a player is eliminated, and when it would normally just move past an eliminated player, it just crashes. I can't find a single problem in here. Maybe I'm just blind, but, here it is.
|
In response to Lummox JR
|
|
*nod* Lists would be good, as it would make gameplay More or less than 4 Players, minimum of two of course. Thanks, I never really thought of that (Heh)
|
In response to Hanns
|
|
Hanns wrote:
*nod* Lists would be good, as it would make gameplay More or less than 4 Players, minimum of two of course. Thanks, I never really thought of that (Heh) Lists aren't too hard to keep track of here. I keep a turn index and just use procs to tell who's in the game. var/list/turnorder=list() // reset this for a new game Lummox JR |
In response to Lummox JR
|
|
I can scarcely understand that for some reason, heh.
|
In response to Hanns
|
|
Okay, there's no way I can figure out the implementation for this. And I irreversably screwed up the entire DM file trying to find a way to.
|
There seem to be a lot of problems with the implementation here, any of which could be responsible for the bug you've got. Among them: You have nextturn() calling itself without spawning out, which is a really bad idea.
Another problem is that you've set up all these vars like el1, el2, etc. when a list would be much, much, much more appropriate. In fact your entire proc would be simplified by using a list of players, because an elimination would involve just removing a player from the list. The way you've got it right now, there's a lot of redundant code because you're doing something over and over and over again in a very similar way. That's just about always a sign that you should be using a more general var or list instead.
Lummox JR