382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
}
static Value destroy(Uint32 from,Uint32 to,Uint32 why) {
Object*o;
Value v;
int i,x,y,xx,yy;
Uint32 n;
if(n==VOIDLINK) return NVALUE(0);
o=objects[to];
// Not checking if it is already destroyed, since EKS Hero Mesh doesn't check.
v=send_message(from,to,MSG_DESTROY,NVALUE(0),NVALUE(0),NVALUE(why));
if(!v_bool(v)) {
o->oflags|=OF_DESTROYED;
if(firstobj==to) firstobj=o->next;
if(lastobj==to) lastobj=o->prev;
if(o->prev!=VOIDLINK) objects[o->prev]->next=o->next;
if(o->next!=VOIDLINK) objects[o->next]->prev=o->prev;
|
|
|
|
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
}
static Value destroy(Uint32 from,Uint32 to,Uint32 why) {
Object*o;
Value v;
int i,x,y,xx,yy;
Uint32 n;
if(to==VOIDLINK) return NVALUE(0);
o=objects[to];
// EKS Hero Mesh doesn't check if it already destroyed.
v=send_message(from,to,MSG_DESTROY,NVALUE(0),NVALUE(0),NVALUE(why));
if(!v_bool(v)) {
o->oflags|=OF_DESTROYED;
if(firstobj==to) firstobj=o->next;
if(lastobj==to) lastobj=o->prev;
if(o->prev!=VOIDLINK) objects[o->prev]->next=o->next;
if(o->next!=VOIDLINK) objects[o->next]->prev=o->prev;
|
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
case OP_DEPARTED_C: StackReq(1,1); Push(GetVariableOf(departed&0x1FFFFFF,NVALUE)); break;
case OP_DEPARTED_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->departed=t1.u; break;
case OP_DEPARTED_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->departed=t1.u; break;
case OP_DEPARTURES: StackReq(0,1); Push(NVALUE(o->departures&0x1FFFFFF)); break;
case OP_DEPARTURES_C: StackReq(1,1); Push(GetVariableOrAttributeOf(departures&0x1FFFFFF,NVALUE)); break;
case OP_DEPARTURES_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->departures=t1.u; break;
case OP_DEPARTURES_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->departures=t1.u; break;
case OP_DESTROYED: StackReq(0,1); if(o->oflags&OF_DESTROYED) Push(NVALUE(1)); else Push(NVALUE(0)); break;
case OP_DESTROYED_C: StackReq(1,1); GetFlagOf(OF_DESTROYED); break;
case OP_DIR: StackReq(0,1); Push(NVALUE(o->dir)); break;
case OP_DIR_C: StackReq(1,1); Push(GetVariableOf(dir,NVALUE)); break;
case OP_DIR_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->dir=resolve_dir(obj,t1.u); break;
case OP_DIR_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->dir=resolve_dir(i,t1.u); break;
case OP_DISTANCE: StackReq(0,1); Push(NVALUE(o->distance)); break;
|
>
>
>
>
|
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
|
case OP_DEPARTED_C: StackReq(1,1); Push(GetVariableOf(departed&0x1FFFFFF,NVALUE)); break;
case OP_DEPARTED_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->departed=t1.u; break;
case OP_DEPARTED_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->departed=t1.u; break;
case OP_DEPARTURES: StackReq(0,1); Push(NVALUE(o->departures&0x1FFFFFF)); break;
case OP_DEPARTURES_C: StackReq(1,1); Push(GetVariableOrAttributeOf(departures&0x1FFFFFF,NVALUE)); break;
case OP_DEPARTURES_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->departures=t1.u; break;
case OP_DEPARTURES_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->departures=t1.u; break;
case OP_DESTROY: NoIgnore(); StackReq(0,1); Push(destroy(obj,obj,0)); break;
case OP_DESTROY_C: NoIgnore(); StackReq(1,1); i=v_object(Pop()); Push(destroy(obj,i,0)); break;
case OP_DESTROY_D: NoIgnore(); destroy(obj,obj,0); break;
case OP_DESTROY_CD: NoIgnore(); StackReq(1,0); i=v_object(Pop()); destroy(obj,i,0); break;
case OP_DESTROYED: StackReq(0,1); if(o->oflags&OF_DESTROYED) Push(NVALUE(1)); else Push(NVALUE(0)); break;
case OP_DESTROYED_C: StackReq(1,1); GetFlagOf(OF_DESTROYED); break;
case OP_DIR: StackReq(0,1); Push(NVALUE(o->dir)); break;
case OP_DIR_C: StackReq(1,1); Push(GetVariableOf(dir,NVALUE)); break;
case OP_DIR_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->dir=resolve_dir(obj,t1.u); break;
case OP_DIR_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->dir=resolve_dir(i,t1.u); break;
case OP_DISTANCE: StackReq(0,1); Push(NVALUE(o->distance)); break;
|