Jump to content
  • 0

Solved Error compile with this mapflag


Yaziid91

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  04/20/19
  • Last Seen:  

<script src="https://gist.github.com/Litro/37bd40c7fc6374d6952d976cb8652e39.js"></script>

 

Hello, I have an error in this source could someone tell me how to correct the mob.cpp part for new emu

 

mob.cpp: In function ‘void mob_log_damage(mob_data*, block_list*, int)’:
mob.cpp:2394:38: error: ‘struct map_data’ has no member named ‘flag’; did you mean ‘std::vector<int> map_data::flags’? (not accessible from this context)
 2394 |                         if (mapdata->flag[MF_ATTACKMOBEVENT])
      |                                      ^~~~
In file included from status.hpp:17,
                 from mob.hpp:13,
                 from mob.cpp:4:
map.hpp:857:26: note: declared private here
  857 |         std::vector<int> flags;
      |                          ^~~~~
mob.cpp:2395:42: error: invalid initialization of reference of type ‘map_session_data&’ from expression of type ‘map_session_data*’
 2395 |                         npc_script_event(sd, NPCE_ATTACKMOBEVENT);
      |                                          ^~
In file included from mob.cpp:37:
npc.hpp:1819:44: note: in passing argument 1 of ‘size_t npc_script_event(map_session_data&, npce_event)’
 1819 | size_t npc_script_event( map_session_data& sd, enum npce_event type );

 

Edit:

Solved :

struct map_data *mapdata = map_getmapdata(sd->bl.m); 
if (map_getmapflag(sd->bl.m, MF_ATTACKMOBEVENT) && sd != nullptr) { 
npc_script_event(*sd, NPCE_ATTACKMOBEVENT); 
}

 

Edited by Yaziid91
solver
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...