Free Hero Mesh

Check-in [73439c4682]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Check for collision layers when adding objects in the editor
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 73439c4682e73b4d15d8bdfd871fdc5d3cfa68e4
User & Date: user on 2021-02-11 22:37:04
Other Links: manifest | tags
Context
2021-02-11
22:51
Always use objtrash to free objects in editor, not free check-in: b8f0f5f65a user: user tags: trunk
22:37
Check for collision layers when adding objects in the editor check-in: 73439c4682 user: user tags: trunk
05:54
Add the MOVE_LIST() SQL function check-in: 1c75f94d6b user: user tags: trunk
Changes

Modified edit.c from [24b1ea6d74] to [ecf182b369].

393
394
395
396
397
398
399
400


401

402
403
404
405










406
407
408
409
410
411
412
393
394
395
396
397
398
399

400
401
402
403




404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420







-
+
+

+
-
-
-
-
+
+
+
+
+
+
+
+
+
+







        exit(0);
        break;
    }
  }
}

static void add_object_at(int x,int y,MRU*m,int d) {
  Uint32 n;
  Uint32 n,u;
  Class*c;
  if(x<1 || x>pfwidth || y<1 || y>pfheight || !m || !m->class) return;
  c=classes[m->class];
  if(d) {
    n=playfield[y*64+x-65];
    while(n!=VOIDLINK) {
      if(objects[n]->class==m->class) return;
  if(!c) return;
  n=playfield[y*64+x-65];
  while(n!=VOIDLINK) {
    if(d && objects[n]->class==m->class) return;
    if(c->collisionLayers&classes[objects[n]->class]->collisionLayers) {
      u=objects[n]->up;
      pfunlink(n);
      free(objects[n]);
      n=u;
    } else {
      n=objects[n]->up;
    }
  }
  n=objalloc(m->class);
  if(n==VOIDLINK) return;
  objects[n]->x=x;
  objects[n]->y=y;