984
985
986
987
988
989
990
991
992
993
994
995
996
997
|
if((o->oflags^OF_CONNECTION)&(OF_MOVING|OF_DESTROYED|OF_CONNECTION|OF_BIZARRO)) return;
conn[nconn].obj=obj;
conn[nconn].id=nconn; // used for stable sorting
conn[nconn].visual=(o->oflags&OF_VISUALONLY)?1:0;
o->oflags|=OF_MOVING|OF_VISUALONLY;
nconn++;
}
static int fake_move_dir(Uint32 obj,Uint32 dir,Uint8 no) {
// This is similar to move_dir, but specialized for the HIT/HITBY processing in connected_move.
// Note that this may result in calling the real move_dir due to shoving.
Object*o;
Object*oE;
Object*oF;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
|
if((o->oflags^OF_CONNECTION)&(OF_MOVING|OF_DESTROYED|OF_CONNECTION|OF_BIZARRO)) return;
conn[nconn].obj=obj;
conn[nconn].id=nconn; // used for stable sorting
conn[nconn].visual=(o->oflags&OF_VISUALONLY)?1:0;
o->oflags|=OF_MOVING|OF_VISUALONLY;
nconn++;
}
static void add_connection_shov(Object*o) {
int i,x,y;
Uint8 b=classes[o->class]->collisionLayers;
Uint32 n;
for(i=0;i<8;i++) if(o->shovable&(0x100<<i)) {
x=o->x+x_delta[i]; y=o->y+y_delta[i];
if(x<1 || x>pfwidth || y<1 || y>pfheight) continue;
n=playfield[x+y*64-65];
while(n!=VOIDLINK) {
if(classes[objects[n]->class]->collisionLayers==b && (objects[n]->shovable&(0x100<<(4^i)))) add_connection(n);
n=objects[n]->up;
}
}
}
static int fake_move_dir(Uint32 obj,Uint32 dir,Uint8 no) {
// This is similar to move_dir, but specialized for the HIT/HITBY processing in connected_move.
// Note that this may result in calling the real move_dir due to shoving.
Object*o;
Object*oE;
Object*oF;
|
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
|
int last;
int i,j;
if(nconn!=pconn) Throw("Improper nested connected move");
// Find and add all connections
add_connection(obj);
for(i=first;i<nconn;i++) {
loop1:
objects[n=conn[i].obj]->inertia=inertia;
if(v_bool(send_message(obj,n,MSG_CONNECT,NVALUE(i-first),NVALUE(dir),NVALUE(weight)))) goto fail;
weight+=objects[n]->weight;
}
if(conn_option&0x01) {
for(i=first;i<nconn;i++) {
o=objects[conn[i].obj];
if(o->inertia<weight) goto fail;
inertia-=o->weight;
}
|
|
>
|
>
|
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
|
int last;
int i,j;
if(nconn!=pconn) Throw("Improper nested connected move");
// Find and add all connections
add_connection(obj);
for(i=first;i<nconn;i++) {
loop1:
o=objects[n=conn[i].obj];
o->inertia=inertia;
if(v_bool(send_message(obj,n,MSG_CONNECT,NVALUE(i-first),NVALUE(dir),NVALUE(weight)))) goto fail;
weight+=o->weight;
if(o->shovable&0xFF00) add_connection_shov(o);
}
if(conn_option&0x01) {
for(i=first;i<nconn;i++) {
o=objects[conn[i].obj];
if(o->inertia<weight) goto fail;
inertia-=o->weight;
}
|