Skip to content

Commit

Permalink
[12513] Fixup commit 12511 Thanks to Zakamurite for pointing
Browse files Browse the repository at this point in the history
Also thanks to him for giving a helping hand in correcting the commit
  • Loading branch information
Schmoozerd committed May 23, 2013
1 parent 256f99a commit 3348191
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/game/Player.cpp
Expand Up @@ -4848,6 +4848,7 @@ void Player::RepopAtGraveyard()
// and don't show spirit healer location
if (ClosestGrave)
{
bool updateVisibility = IsInWorld() && GetMapId() == ClosestGrave->map_id;
TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation());
if (isDead()) // not send if alive, because it used in TeleportTo()
{
Expand All @@ -4858,7 +4859,8 @@ void Player::RepopAtGraveyard()
data << ClosestGrave->z;
GetSession()->SendPacket(&data);
}
UpdateVisibilityAndView();
if (updateVisibility && IsInWorld())
UpdateVisibilityAndView();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12512"
#define REVISION_NR "12513"
#endif // __REVISION_NR_H__

5 comments on commit 3348191

@Lillecarl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool updateVisibility = IsInWorld() && GetMapId() == ClosestGrave->map_id;
if (updateVisibility && IsInWorld())
????

if (updateVisibility)

should be enough?

@Schmoozerd
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe - the thing is this depends a bit on the actual implementation of TeleportTo;
sometimes even for teleporting on the same map there can be a loading screen.
Whilst this happens i do not know if IsInWorld is expected to be true.
In the moment the loading-screen is triggered not within the TeleportTo function, but possible someplace else.
Anyhow the IsInWorld check appeared resonable in case the mechanic of TeleportTo function would be changed someday.

@Lillecarl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually i did some research on this, and it seems like there are no way really to check if a player has loaded their screens done. I hooked my code tho the "timer opcode" the client sends (some custom code), because it's only sent once players have finished loading screen.

But yeah this should prolly do =)

@boxa
Copy link
Contributor

@boxa boxa commented on 3348191 May 24, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have ugly creature rotation in random movement. i'm found a good description and example how this should be maked: http://www.gamasutra.com/view/feature/131505/toward_more_realistic_pathfinding.php?page=3

message for skilled mans:
faramir
zergtmn
Cyberium

i think this should be on pathfinding level.

@Schmoozerd
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hardly the most pressing problem with random MMGen at the moment :(

most important would be (in order)

  1. fix random point's height (see other issues + forum thread)
  2. limit lenght of random path to some reasonable value
  3. fix random-distance in a generic way to have better results (dragons with 5y random movement is just stupid)

Edit: Aside from this: why not create an issue/ forum thread for this, after all here as comment to some random commit this just will get forgotten.

Please sign in to comment.