Free Hero Mesh

Check-in [c2b53e3cd8]
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:Prevent double triggering of ARRIVED and DEPARTED messages. This fixes some test cases, although some test cases still fail.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c2b53e3cd8a149a44af81538861ea2983f602d89
User & Date: user on 2021-03-07 00:56:26
Other Links: manifest | tags
Context
2021-03-07
03:53
Make some changes for the case when both -a and -t are specified check-in: 4f7bcb6296 user: user tags: trunk
00:56
Prevent double triggering of ARRIVED and DEPARTED messages. This fixes some test cases, although some test cases still fail. check-in: c2b53e3cd8 user: user tags: trunk
2021-03-06
06:04
Add level exporting. (Importing is not implemented yet.) check-in: dd82c6e9b5 user: user tags: trunk
Changes

Modified exec.c from [44b8888e4d] to [f09a3b0fbd].

1870
1871
1872
1873
1874
1875
1876
1877

1878
1879
1880
1881
1882

1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909

1910
1911
1912
1913
1914
1915
1916
        objtrash(n);
      } else if(classes[o->class]->cflags&CF_COMPATIBLE) {
        if((o->oflags&(OF_MOVED|OF_MOVED2))==OF_MOVED) {
          o->oflags=(o->oflags|OF_MOVED2)&~OF_MOVED;
          send_message(VOIDLINK,n,MSG_MOVED,NVALUE(0),NVALUE(0),NVALUE(turn));
          busy=1;
        }
        if(o->departed) {

          send_message(VOIDLINK,n,MSG_DEPARTED,NVALUE(0),NVALUE(0),NVALUE(turn));
          o->departed=0;
          busy=1;
        }
        if(o->arrived) {

          send_message(VOIDLINK,n,MSG_ARRIVED,NVALUE(0),NVALUE(0),NVALUE(turn));
          o->arrived=0;
          busy=1;
        }
        if(o->anim && (o->anim->status&ANISTAT_LOGICAL)) execute_animation(n);
        if(o->oflags&(OF_BUSY|OF_USERSIGNAL)) busy=1;
      } else {
        o->departed2=o->departed;
        o->departed=0;
        o->arrived2=o->arrived;
        o->arrived=0;
        if(o->oflags&OF_MOVED) o->oflags=(o->oflags|OF_MOVED2)&~OF_MOVED;
      }
      n=m;
    }
  }
  n=lastobj;
  while(n!=VOIDLINK) {
    o=objects[n];
    if(!(classes[o->class]->cflags&CF_COMPATIBLE)) {
      if(o->oflags&OF_MOVED2) send_message(VOIDLINK,n,MSG_MOVED,NVALUE(0),NVALUE(0),NVALUE(turn)),busy=1;
      if(o->departed2) send_message(VOIDLINK,n,MSG_DEPARTED,NVALUE(o->departed2),NVALUE(0),NVALUE(turn)),busy=1;
      if(o->arrived2) send_message(VOIDLINK,n,MSG_ARRIVED,NVALUE(o->arrived2),NVALUE(0),NVALUE(turn)),busy=1;
      o->arrived2=o->departed2=0;
      if(o->anim && (o->anim->status&ANISTAT_LOGICAL)) execute_animation(n);
      if(o->oflags&(OF_BUSY|OF_USERSIGNAL)) busy=1;
    }

    o->oflags&=~OF_MOVED2;
    n=o->prev;
  }
  // Ending phase
  if(!busy && !all_flushed) {
    n=lastobj;
    while(n!=VOIDLINK) {







|
>




|
>







<
|
|
|












<



>







1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891

1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906

1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
        objtrash(n);
      } else if(classes[o->class]->cflags&CF_COMPATIBLE) {
        if((o->oflags&(OF_MOVED|OF_MOVED2))==OF_MOVED) {
          o->oflags=(o->oflags|OF_MOVED2)&~OF_MOVED;
          send_message(VOIDLINK,n,MSG_MOVED,NVALUE(0),NVALUE(0),NVALUE(turn));
          busy=1;
        }
        if(o->departed && !o->departed2) {
          o->departed2=1;
          send_message(VOIDLINK,n,MSG_DEPARTED,NVALUE(0),NVALUE(0),NVALUE(turn));
          o->departed=0;
          busy=1;
        }
        if(o->arrived && !o->arrived2) {
          o->arrived2=1;
          send_message(VOIDLINK,n,MSG_ARRIVED,NVALUE(0),NVALUE(0),NVALUE(turn));
          o->arrived=0;
          busy=1;
        }
        if(o->anim && (o->anim->status&ANISTAT_LOGICAL)) execute_animation(n);
        if(o->oflags&(OF_BUSY|OF_USERSIGNAL)) busy=1;
      } else {

        o->departed2|=o->departed;
        o->arrived2|=o->arrived;
        o->departed=o->arrived=0;
        if(o->oflags&OF_MOVED) o->oflags=(o->oflags|OF_MOVED2)&~OF_MOVED;
      }
      n=m;
    }
  }
  n=lastobj;
  while(n!=VOIDLINK) {
    o=objects[n];
    if(!(classes[o->class]->cflags&CF_COMPATIBLE)) {
      if(o->oflags&OF_MOVED2) send_message(VOIDLINK,n,MSG_MOVED,NVALUE(0),NVALUE(0),NVALUE(turn)),busy=1;
      if(o->departed2) send_message(VOIDLINK,n,MSG_DEPARTED,NVALUE(o->departed2),NVALUE(0),NVALUE(turn)),busy=1;
      if(o->arrived2) send_message(VOIDLINK,n,MSG_ARRIVED,NVALUE(o->arrived2),NVALUE(0),NVALUE(turn)),busy=1;

      if(o->anim && (o->anim->status&ANISTAT_LOGICAL)) execute_animation(n);
      if(o->oflags&(OF_BUSY|OF_USERSIGNAL)) busy=1;
    }
    o->arrived2=o->departed2=0;
    o->oflags&=~OF_MOVED2;
    n=o->prev;
  }
  // Ending phase
  if(!busy && !all_flushed) {
    n=lastobj;
    while(n!=VOIDLINK) {