Foob Posted April 26, 2020 Group: Members Topic Count: 46 Topics Per Day: 0.02 Content Count: 267 Reputation: 40 Joined: 01/19/17 Last Seen: January 12, 2023 Share Posted April 26, 2020 Hello, I'm trying to edit clif_broadcast function from clif.cpp to work with player who has var like example below. void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, enum send_target target) { nullpo_retv(mes); if (len < 2) return; int lp = (type&BC_COLOR_MASK) ? 4 : 0; std::unique_ptr<unsigned char> buf(new unsigned char[4+lp+len]); WBUFW(buf.get(),0) = 0x9a; WBUFW(buf.get(),2) = 4 + lp + len; if (type&BC_BLUE) WBUFL(buf.get(),4) = 0x65756c62; //If there's "blue" at the beginning of the message, game client will display it in blue instead of yellow. else if (type&BC_WOE) WBUFL(buf.get(),4) = 0x73737373; //If there's "ssss", game client will recognize message as 'WoE broadcast'. memcpy(WBUFP(buf.get(), 4 + lp), mes, len); struct map_session_data* sd; nullpo_retv(sd); int counter = static_cast<int>(pc_readreg2( sd, MY_VAR )); if(counter < 1) clif_send(buf.get(), WBUFW(buf.get(),2), bl, target); } When I compile, there's a problem where it says: "uninitialized local variable 'sd' used" The server will start but come broadcast it will crash and will point out to the line. What am I missing? Is this possible? Quote Link to comment Share on other sites More sharing options...
Question
Foob
Hello,
I'm trying to edit clif_broadcast function from clif.cpp to work with player who has var like example below.
When I compile, there's a problem where it says: "uninitialized local variable 'sd' used"
The server will start but come broadcast it will crash and will point out to the line. What am I missing? Is this possible?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.