Buff pet range/despawning

01/07/2018 06:49 FlyffDeveloper#1
Hey everyone,

I have an issue on my server where whenever we teleport from the siege spawn location to the arena our buff pets are despawning. And also if you get too much speed you can outrun your buff pet (even with its speed increased).

I tried a few times to increase the range of buffpets but I still have the same problem.

Anyone have any tips on how to fix this by either increasing the range of the pets or disable the despawning. I tried looking for it myself but I haven't really been able to find something that makes me confident about a fix.
01/14/2018 06:29 FlyffDeveloper#2
Quote:
Originally Posted by Hekmatyar View Post
I wouldn't be posting here if I was able to fix it after trying out various things myself. I disabled most of the obvious places where a pet is despawned after a range or location check but it still seems to happen.
01/14/2018 16:17 Sedrika#3
Set a flag if you're teleporting and a pet is spawned.
Respawn pet if flag is true after teleporting.

And while spawning set the pets speed to player speed if you want.
01/16/2018 11:06 FlyffDeveloper#4
For those who also might be interested in a similar fix (or have suggestions for better improvements).

I have fixed the problem by adding this in the JoinWar() for the Siege code.

Code:
	
bool reActivatePet = false;
CItemElem* pPetItem;

if( ((CMover*)pUser)->HasActivatedEatPet())
{
	reActivatePet = true;
	pPetItem = ((CMover*)pUser)->GetVisPetItem();
}
	
((CMover*)pUser)->REPLACE( g_uIdofMulti, WI_WORLD_GUILDWAR, v3Pos[nMap], REPLACE_NORMAL, nDefaultLayer );

pUser->m_vtInfo.SetOther( NULL );
	
if(reActivatePet)
	((CMover*)pUser)->ActivateEatPet(pPetItem);
01/16/2018 18:01 ディオニュソス#5
Quote:
Originally Posted by FlyffDeveloper View Post
For those who also might be interested in a similar fix (or have suggestions for better improvements).

I have fixed the problem by adding this in the JoinWar() for the Siege code.

Code:
	
bool reActivatePet = false;
CItemElem* pPetItem;

if( ((CMover*)pUser)->HasActivatedEatPet())
{
	reActivatePet = true;
	pPetItem = ((CMover*)pUser)->GetVisPetItem();
}
	
((CMover*)pUser)->REPLACE( g_uIdofMulti, WI_WORLD_GUILDWAR, v3Pos[nMap], REPLACE_NORMAL, nDefaultLayer );

pUser->m_vtInfo.SetOther( NULL );
	
if(reActivatePet)
	((CMover*)pUser)->ActivateEatPet(pPetItem);
How to implement a possible server crash 101
01/16/2018 18:50 FlyffDeveloper#6
Quote:
Originally Posted by ディオニュソス View Post
How to implement a possible server crash 101

What do you suggest could cause that? I'm still new so always willing to learn how to code flyff better.
01/16/2018 19:28 ディオニュソス#7
Quote:
Originally Posted by FlyffDeveloper View Post
What do you suggest could cause that? I'm still new so always willing to learn how to code flyff better.
Idk, there are plenty of possibilities, I'd probably call Replace on the loot pet mover. That works as long as it doesn't switch worlds.
You'd have to adjust CMover::Replace though in order to disable the deactivation of the pet when an actual player is being teleported.
Up to you, according to your name you're a flyff developer so I'm sure you can figure that one out on your own.