Free Hero Mesh

Check-in [3aa2e5e3bd]
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:Correct the implementation of sink() so that the objects above and below the ones being switched are linked correctly; also, objtrash() does not need to reset the up/down links
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3aa2e5e3bd8bd252dfb59f31a1bbb9fc29341160
User & Date: user on 2020-12-18 02:00:30
Other Links: manifest | tags
Context
2020-12-18
08:07
Many changes (still not quite right, it seems) check-in: a5ad5e4eeb user: user tags: trunk
02:00
Correct the implementation of sink() so that the objects above and below the ones being switched are linked correctly; also, objtrash() does not need to reset the up/down links check-in: 3aa2e5e3bd user: user tags: trunk
2020-12-17
22:10
Implement the rest of the phases of the turn; still not working perfectly though check-in: f4f4383c4e user: user tags: trunk
Changes

Modified exec.c from [bcf1e42af2] to [4dabc08567].

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
void objtrash(Uint32 n) {
  Object*o=objects[n];
  if(!o) return;
  animfree(o->anim);
  if(o->down==VOIDLINK) playfield[o->x+o->y*64-65]=o->up;
  else objects[o->down]->up=o->up;
  if(o->up!=VOIDLINK) objects[o->up]->down=o->down;
  o->down=o->up=VOIDLINK;
  if(!(o->oflags&OF_DESTROYED)) {
    if(firstobj==n) firstobj=o->next;
    if(lastobj==n) lastobj=o->prev;
    if(o->prev!=VOIDLINK) objects[o->prev]->next=o->next;
    if(o->next!=VOIDLINK) objects[o->next]->prev=o->prev;
  }
  free(o);







<







158
159
160
161
162
163
164

165
166
167
168
169
170
171
void objtrash(Uint32 n) {
  Object*o=objects[n];
  if(!o) return;
  animfree(o->anim);
  if(o->down==VOIDLINK) playfield[o->x+o->y*64-65]=o->up;
  else objects[o->down]->up=o->up;
  if(o->up!=VOIDLINK) objects[o->up]->down=o->down;

  if(!(o->oflags&OF_DESTROYED)) {
    if(firstobj==n) firstobj=o->next;
    if(lastobj==n) lastobj=o->prev;
    if(o->prev!=VOIDLINK) objects[o->prev]->next=o->next;
    if(o->next!=VOIDLINK) objects[o->next]->prev=o->prev;
  }
  free(o);
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
  Object*p=objects[y];
  int i=o->x+o->y*64-65;
  Value v;
  p->up=o->up;
  o->down=p->down;
  o->up=y;
  p->down=x;
  if(o->down==VOIDLINK && !(o->oflags&OF_BIZARRO)) playfield[i]=x;
  if(p->down==VOIDLINK && !(p->oflags&OF_BIZARRO)) playfield[i]=y;
  v=send_message(x,y,MSG_FLOATED,NVALUE(0),NVALUE(0),NVALUE(0));
  if(!((o->oflags|p->oflags)&(OF_VISUALONLY|OF_DESTROYED))) send_message(y,x,MSG_SUNK,NVALUE(0),NVALUE(0),v);
}

static void change_density(Uint32 n,Sint32 v) {
  Object*o=objects[n];
  Uint32 i;







|
|







397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
  Object*p=objects[y];
  int i=o->x+o->y*64-65;
  Value v;
  p->up=o->up;
  o->down=p->down;
  o->up=y;
  p->down=x;
  if(o->down==VOIDLINK) playfield[i]=x; else objects[o->down]->up=x;
  if(p->up!=VOIDLINK) objects[p->up]->down=y;
  v=send_message(x,y,MSG_FLOATED,NVALUE(0),NVALUE(0),NVALUE(0));
  if(!((o->oflags|p->oflags)&(OF_VISUALONLY|OF_DESTROYED))) send_message(y,x,MSG_SUNK,NVALUE(0),NVALUE(0),v);
}

static void change_density(Uint32 n,Sint32 v) {
  Object*o=objects[n];
  Uint32 i;