Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-20-2015, 02:54 PM
iluvseq
Sarnak
 
Join Date: Aug 2009
Location: Somewhere
Posts: 53
Default Patch: Only check for swimming skill ups if client is moving

The current code checks for swimming skill increases every ClientUpdate packet even if the character is not moving around. On live, a client has to actually be moving through the water to get a skill increase.

This patch fixes that (and also gives a bigger modifier to the check, so that swimming skill ups aren't as frequent).

Of course, this probably only matters for servers who have commented out SetSkill(SkillSwimming, 100); which should probably be modified to be a server rule rather than hard-coded...

Code:
diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp
index 46c00bf..fc8b6c6 100644
--- a/zone/client_packet.cpp
+++ b/zone/client_packet.cpp
@@ -4556,7 +4556,9 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
  }

  // Break Hide if moving without sneaking and set rewind timer if moved
+ bool moving = false;
  if(ppu->y_pos != m_Position.m_Y || ppu->x_pos != m_Position.m_X){
+   moving = true;
    if((hidden || improved_hidden) && !sneaking){
      hidden = false;
      improved_hidden = false;
@@ -4595,8 +4597,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
    safe_delete(outapp);
  }

- if(zone->watermap && zone->watermap->InLiquid(m_Position))
-        CheckIncreaseSkill(SkillSwimming, nullptr, -17);
+ if(zone->watermap && zone->watermap->InLiquid(m_Position) && moving)
+        CheckIncreaseSkill(SkillSwimming, nullptr, -25);

  return;
 }
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:56 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3