diff options
author | rodri <rgl@antares-labs.eu> | 2023-10-07 21:45:55 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-10-07 21:45:55 +0000 |
commit | c5ca61912a88aeb8ae727c0d217b7dc41efeb00d (patch) | |
tree | 25480308bdb35accbfefeea22df07b395b403580 | |
parent | 353cbde75a19b004ab0c5339684f33ea47ef1244 (diff) | |
download | battleship-c5ca61912a88aeb8ae727c0d217b7dc41efeb00d.tar.gz battleship-c5ca61912a88aeb8ae727c0d217b7dc41efeb00d.tar.bz2 battleship-c5ca61912a88aeb8ae727c0d217b7dc41efeb00d.zip |
tell the spectator who's playing the moment they join.
-rw-r--r-- | andy.c | 3 | ||||
-rw-r--r-- | btsd.c | 7 |
2 files changed, 5 insertions, 5 deletions
@@ -1,15 +1,12 @@ #include <u.h> #include <libc.h> -#include <bio.h> #include <thread.h> #include <draw.h> #include <mouse.h> -#include <cursor.h> #include <keyboard.h> #include <geometry.h> #include "dat.h" #include "fns.h" -#include "mixer.h" /* Nexus-9 technology from The Rosen Association */ @@ -559,11 +559,14 @@ Nocmd: p->battle = m; chanprint(p->io.out, "watching %d %s %s\n", m->id, m->pl[0]->name, m->pl[1]->name); - for(i = 0; i < nelem(m->pl); i++) + for(i = 0; i < nelem(m->pl); i++){ if(m->pl[i]->state != Outlaying){ bitpackmap(buf, sizeof buf, m->pl[i]); chanprint(p->io.out, "outlayed %d %.*[\n", i, sizeof buf, buf); } + if(m->pl[i]->state == Playing) + chanprint(p->io.out, "plays %d\n", i); + } }else if(strcmp(msg->body, "leave seat") == 0){ leaveseat(&stands, p); p->state = Waiting0; @@ -619,7 +622,7 @@ matchmaker(void *) pl[0]->battle = m; pl[1]->battle = m; i = 0; - + proccreate(battleproc, m, mainstacksize); } a[QUE].v = &pl[i]; |