Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. diff --git a/Common/ac/characterinfo.cpp b/Common/ac/characterinfo.cpp
  2. index dbcbcf39..2cfb1561 100644
  3. --- a/Common/ac/characterinfo.cpp
  4. +++ b/Common/ac/characterinfo.cpp
  5. @@ -31,7 +31,7 @@ void CharacterInfo::ReadFromFile(Stream *in)
  6. wait = in->ReadInt32();
  7. flags = in->ReadInt32();
  8. following = in->ReadInt16();
  9. - followinfo = in->ReadInt16();
  10. + followinfo = in->ReadInt32();
  11. idleview = in->ReadInt32();
  12. idletime = in->ReadInt16();
  13. idleleft = in->ReadInt16();
  14. @@ -81,7 +81,7 @@ void CharacterInfo::WriteToFile(Stream *out)
  15. out->WriteInt32(wait);
  16. out->WriteInt32(flags);
  17. out->WriteInt16(following);
  18. - out->WriteInt16(followinfo);
  19. + out->WriteInt32(followinfo);
  20. out->WriteInt32(idleview);
  21. out->WriteInt16(idletime);
  22. out->WriteInt16(idleleft);
  23. diff --git a/Common/ac/characterinfo.h b/Common/ac/characterinfo.h
  24. index f3140d15..65ba1ccb 100644
  25. --- a/Common/ac/characterinfo.h
  26. +++ b/Common/ac/characterinfo.h
  27. @@ -44,7 +44,7 @@ using namespace AGS; // FIXME later
  28. #define OCHF_SPEECHCOL 0xff000000
  29. #define OCHF_SPEECHCOLSHIFT 24
  30. #define UNIFORM_WALK_SPEED 0
  31. -#define FOLLOW_ALWAYSONTOP 0x7ffe
  32. +#define FOLLOW_ALWAYSONTOP 0x7ffffffe
  33.  
  34. struct CharacterExtras; // forward declaration
  35. // remember - if change this struct, also change AGSDEFNS.SH and
  36. @@ -57,7 +57,7 @@ struct CharacterInfo {
  37. int x, y, wait;
  38. int flags;
  39. short following;
  40. - short followinfo;
  41. + int followinfo;
  42. int idleview; // the loop will be randomly picked
  43. short idletime, idleleft; // num seconds idle before playing anim
  44. short transparency; // if character is transparent
  45. diff --git a/Engine/ac/character.cpp b/Engine/ac/character.cpp
  46. index 5eb3a21c..07c56cce 100644
  47. --- a/Engine/ac/character.cpp
  48. +++ b/Engine/ac/character.cpp
  49. @@ -495,7 +495,7 @@ void Character_FollowCharacter(CharacterInfo *chaa, CharacterInfo *tofollow, int
  50. else
  51. chaa->following = tofollow->index_id;
  52.  
  53. - chaa->followinfo=(distaway << 8) | eagerness;
  54. + chaa->followinfo=(distaway << 16) | eagerness;
  55.  
  56. chaa->flags &= ~CHF_BEHINDSHEPHERD;
  57.  
  58. diff --git a/Engine/ac/characterinfo_engine.cpp b/Engine/ac/characterinfo_engine.cpp
  59. index 8f6f1a5a..e16a69c7 100644
  60. --- a/Engine/ac/characterinfo_engine.cpp
  61. +++ b/Engine/ac/characterinfo_engine.cpp
  62. @@ -388,7 +388,7 @@ void CharacterInfo::update_character_follower(int &aa, int &numSheep, int *follo
  63. }
  64. // not moving, but should be following another character
  65. else if ((following >= 0) && (doing_nothing == 1)) {
  66. - short distaway=(followinfo >> 8) & 0x00ff;
  67. + short distaway=(followinfo >> 16) & 0x00ffff;
  68. // no character in this room
  69. if ((game.chars[following].on == 0) || (on == 0)) ;
  70. else if (room < 0) {
  71. @@ -401,7 +401,7 @@ void CharacterInfo::update_character_follower(int &aa, int &numSheep, int *follo
  72. }
  73. }
  74. // wait a bit, so we're not constantly walking
  75. - else if (Random(100) < (followinfo & 0x00ff)) ;
  76. + else if (Random(100) < (followinfo & 0x00ffff)) ;
  77. // the followed character has changed room
  78. else if ((room != game.chars[following].room)
  79. && (game.chars[following].on == 0))
  80. @@ -446,7 +446,7 @@ void CharacterInfo::update_character_follower(int &aa, int &numSheep, int *follo
  81. }
  82. else if ((abs(game.chars[following].x - x) > distaway+30) |
  83. (abs(game.chars[following].y - y) > distaway+30) |
  84. - ((followinfo & 0x00ff) == 0)) {
  85. + ((followinfo & 0x00ffff) == 0)) {
  86. // in same room
  87. int goxoffs=(Random(50)-25);
  88. // make sure he's not standing on top of the other man
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement