Jump to content

Recommended Posts

Posted

@hidepet / @hidepetall commands


@hidepet allows to hide all pets except the player's, whereas @hidepetall hides all pets, including the player's.

This mod also allows to set a default parameter in battle_conf, just add

hide_pet: 1

To set all pets hidden except the player's, or 2 for all pets period.

 

 


 

  • Upvote 2
  • Love 1
  • MVP 1
  • 3 weeks later...
Posted (edited)

Hello! this warning appeared on the console like this even using the old_clearunit version

In file included from ../common/cbasetypes.hpp:338:0,
                 from atcommand.hpp:7,
                 from atcommand.cpp:4:
../custom/atcommand.inc: In function int atcommand_hidepet_sub(block_list*, __va_list_tag*)’:
../custom/atcommand.inc:449:18: warning: bool is promoted to int when passed through ‘...’
  if (!va_arg(ap, bool) && sd->pd != nullptr && sd->pd->bl.id == bl->id) {
                  ^
../custom/atcommand.inc:449:18: note: (so you should pass int not bool to va_arg’)
../custom/atcommand.inc:449:18: note: if this code is reached, the program will abort
../custom/atcommand.inc:450:17: warning: uint8 {aka unsigned char}’ is promoted to int when passed through ‘...’
   if(va_arg(ap, uint8) == 2)
                 ^
../custom/atcommand.inc:450:17: note: if this code is reached, the program will abort

@edit

Solvet change bool and unit8 to int.  "If this will break I don't know but it worked"

+	if (!va_arg(ap, bool) && sd->pd != nullptr && sd->pd->bl.id == bl->id) {
+		if(va_arg(ap, uint8) == 2)
+			clif_spawn(&sd->pd->bl, true);
+		return 0;
+	}
+

TO

+	if (!va_arg(ap, int) && sd->pd != nullptr && sd->pd->bl.id == bl->id) {
+		if(va_arg(ap, int) == 2)
+			clif_spawn(&sd->pd->bl, true);
+		return 0;
+	}
+

 

Edited by drigoguille
  • Upvote 1
Posted (edited)
On 9/18/2024 at 2:40 PM, drigoguille said:

Hello! this warning appeared on the console like this even using the old_clearunit version

In file included from ../common/cbasetypes.hpp:338:0,
                 from atcommand.hpp:7,
                 from atcommand.cpp:4:
../custom/atcommand.inc: In function int atcommand_hidepet_sub(block_list*, __va_list_tag*)’:
../custom/atcommand.inc:449:18: warning: bool is promoted to int when passed through ‘...’
  if (!va_arg(ap, bool) && sd->pd != nullptr && sd->pd->bl.id == bl->id) {
                  ^
../custom/atcommand.inc:449:18: note: (so you should pass int not bool to va_arg’)
../custom/atcommand.inc:449:18: note: if this code is reached, the program will abort
../custom/atcommand.inc:450:17: warning: uint8 {aka unsigned char}’ is promoted to int when passed through ‘...’
   if(va_arg(ap, uint8) == 2)
                 ^
../custom/atcommand.inc:450:17: note: if this code is reached, the program will abort

@edit

Solvet change bool and unit8 to int.  "If this will break I don't know but it worked"

+	if (!va_arg(ap, bool) && sd->pd != nullptr && sd->pd->bl.id == bl->id) {
+		if(va_arg(ap, uint8) == 2)
+			clif_spawn(&sd->pd->bl, true);
+		return 0;
+	}
+

TO

+	if (!va_arg(ap, int) && sd->pd != nullptr && sd->pd->bl.id == bl->id) {
+		if(va_arg(ap, int) == 2)
+			clif_spawn(&sd->pd->bl, true);
+		return 0;
+	}
+

 

When is your rAthena from? I used one from January 1st 2024 as a base for the old clif_clearunit_single version.

Not sure why you get that warning, since all and prev_state are defined as bool and uint8 respectively.

 

It seems to be an issue with the compiler, I'll fix it on the next version

Edited by Daegaladh
Posted
15 hours ago, louigui0224 said:

How to fix this?

clif_clearunit_single(bl->id, CLR_OUTSIGHT, *sd);


image.png.5f9edc7dd8db0e68b627b86cb3c8cf79.png

Just use the old clif_clearunit_single version or update your rAthena 

Posted
10 hours ago, EAJ_BASEMASK said:
clif_clearunit_single(bl->id, CLR_OUTSIGHT, fd);

 

That's incorrect, there's no direct access to fd on that function. Plus I already provided a fix for that specific version.

Join the conversation

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

Guest
Reply to this topic...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...