445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
}
static Uint32 v_object(Value v) {
if(v.t==TY_NUMBER) {
if(v.u) Throw("Cannot convert non-zero number to object");
return VOIDLINK;
} else if(v.t>TY_MAXTYPE) {
if(v.u>=nobjects || !objects[v.u]) Throw("Attempt to use a nonexistent object");
if(objects[v.u]->generation!=v.t) Throw("Attempt to use a nonexistent object");
return v.u;
} else {
Throw("Cannot convert non-object to object");
}
}
static inline int v_sh_dir(Value x) {
|
|
>
|
>
|
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
|
}
static Uint32 v_object(Value v) {
if(v.t==TY_NUMBER) {
if(v.u) Throw("Cannot convert non-zero number to object");
return VOIDLINK;
} else if(v.t>TY_MAXTYPE) {
if(v.u>=nobjects || !objects[v.u] || objects[v.u]->generation!=v.t) {
if(main_options['t']) printf("Object %lu in generation %lu does not exist\n",(long)v.u,(long)v.t);
Throw("Attempt to use a nonexistent object");
}
return v.u;
} else {
Throw("Cannot convert non-object to object");
}
}
static inline int v_sh_dir(Value x) {
|
746
747
748
749
750
751
752
753
754
755
756
757
758
759
|
}
objE=obj_below(objE);
}
}
} else {
// Orthogonal movement
if(hit) hit=(hit&0x0C000000)|0x800;
objE=objF;
while(objE!=VOIDLINK) {
oE=objects[objE];
if(oE->height>0) {
hit&=~7;
// HIT/HITBY messages
v=send_message(objE,obj,MSG_HIT,NVALUE(oE->x),NVALUE(oE->y),NVALUE(hit));
|
>
|
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
|
}
objE=obj_below(objE);
}
}
} else {
// Orthogonal movement
if(hit) hit=(hit&0x0C000000)|0x800;
if(!oF) goto fail;
objE=objF;
while(objE!=VOIDLINK) {
oE=objects[objE];
if(oE->height>0) {
hit&=~7;
// HIT/HITBY messages
v=send_message(objE,obj,MSG_HIT,NVALUE(oE->x),NVALUE(oE->y),NVALUE(hit));
|
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
|
objE=obj_below(objE);
}
if(hit&0x2008) goto fail;
if((hit&0x48000)==0x8000) goto restart;
if(!(hit&0x400000)) {
if(hF<=o->climb || (hit&0x200000)) {
if(hit&0x20000) goto success;
if(!oF) goto fail;
if(move_to(from,obj,oF->x,oF->y)) goto success; else goto fail;
}
}
// Sliding
if(hit&0x80) goto fail;
hit|=0x10000;
|
<
|
788
789
790
791
792
793
794
795
796
797
798
799
800
801
|
objE=obj_below(objE);
}
if(hit&0x2008) goto fail;
if((hit&0x48000)==0x8000) goto restart;
if(!(hit&0x400000)) {
if(hF<=o->climb || (hit&0x200000)) {
if(hit&0x20000) goto success;
if(move_to(from,obj,oF->x,oF->y)) goto success; else goto fail;
}
}
// Sliding
if(hit&0x80) goto fail;
hit|=0x10000;
|