--- /dev/null
+I: state.qc
+D: test emulated state ops
+T: -execute
+C: -std=gmqcc -femulate-state
+M: st1, .frame=1, .nextthink=10.1 (now: 10)
+M: st2, .frame=2, .nextthink=11.1 (now: 11)
+M: st3, .frame=0, .nextthink=12.1 (now: 12)
+M: st1, .frame=1, .nextthink=13.1 (now: 13)
+M: st2, .frame=2, .nextthink=14.1 (now: 14)
--- /dev/null
+float time;
+entity self;
+
+.void() think;
+.float nextthink;
+.float frame;
+
+void stprint(string fun) {
+ print(fun,
+ ", .frame=", ftos(self.frame),
+ ", .nextthink=", ftos(self.nextthink),
+ " (now: ", ftos(time), ")\n");
+}
+
+void st1() = [1, st2] { stprint("st1"); }
+void st2() = [2, st3] { stprint("st2"); }
+void st3() = [0, st1] { stprint("st3"); }
+
+void main() {
+ entity ea = spawn();
+ entity eb = spawn();
+
+ time = 10;
+ self = ea;
+
+ self.think = st1;
+ self.nextthink = time;
+ self.frame = 100;
+
+ self.think();
+ time = 11;
+ self.think();
+ time = 12;
+ self.think();
+ time = 13;
+ self.think();
+ time = 14;
+ self.think();
+};
--- /dev/null
+I: state.qc
+D: test state ops
+T: -execute
+C: -std=gmqcc
+M: st1, .frame=1, .nextthink=10.1 (now: 10)
+M: st2, .frame=2, .nextthink=11.1 (now: 11)
+M: st3, .frame=0, .nextthink=12.1 (now: 12)
+M: st1, .frame=1, .nextthink=13.1 (now: 13)
+M: st2, .frame=2, .nextthink=14.1 (now: 14)