Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14700
Modified Files:
basechar.cpp basechar.h walking.cpp walking.h
Log Message:
Exchanged runningSteps property with a running boolean property.
Index: walking.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** walking.h 3 Jun 2004 14:43:00 -0000 1.27
--- walking.h 31 Aug 2004 15:18:25 -0000 1.28
***************
*** 65,69 ****
bool checkObstacles( P_CHAR pChar, const Coord_cl& newPos, bool running );
bool verifySequence( cUOSocket* socket, Q_UINT8 sequence ) throw();
- void checkRunning( cUOSocket*, P_CHAR, Q_UINT8 );
void checkStealth( P_CHAR );
void sendWalkToOther( P_PLAYER pChar, P_CHAR pWalker, const Coord_cl& oldpos );
--- 65,68 ----
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.141
retrieving revision 1.142
diff -C2 -d -r1.141 -r1.142
*** walking.cpp 29 Aug 2004 20:40:50 -0000 1.141
--- walking.cpp 31 Aug 2004 15:18:25 -0000 1.142
***************
*** 470,473 ****
--- 470,475 ----
dir = dir & 0x7F; // Remove the running flag
+ pChar->setRunning(running);
+
bool turning = dir != pChar->direction();
***************
*** 623,645 ****
}
- // This only gets called when running
- void cMovement::checkRunning( cUOSocket* socket, P_CHAR pChar, Q_UINT8 /*dir*/ )
- {
- // Don't regenerate stamina while running
- pChar->setRegenStaminaTime( ( uint )( Server::instance()->time() + floor( pChar->getStaminaRate() * 1000 ) ) );
- pChar->setRunningSteps( pChar->runningSteps() + 1 );
-
- // If we're running on our feet, check for stamina loss
- // Crap
- if ( !pChar->isDead() && !pChar->atLayer( cBaseChar::Mount ) && pChar->runningSteps() > ( Config::instance()->runningStamSteps() ) * 2 )
- {
- // The *2 it's because i noticed that a step(animation) correspond to 2 walking calls
- // ^^ WTF?
- pChar->setRunningSteps( 0 );
- pChar->setStamina( pChar->stamina() - 1 );
- socket->updateStamina();
- }
- }
-
void cMovement::checkStealth( P_CHAR pChar )
{
--- 625,628 ----
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -d -r1.138 -r1.139
*** basechar.cpp 31 Aug 2004 14:04:53 -0000 1.138
--- basechar.cpp 31 Aug 2004 15:18:25 -0000 1.139
***************
*** 92,96 ****
creationDate_ = QDateTime::currentDateTime();
stealthedSteps_ = 0;
! runningSteps_ = 0;
murdererTime_ = 0;
criminalTime_ = 0;
--- 92,96 ----
creationDate_ = QDateTime::currentDateTime();
stealthedSteps_ = 0;
! running_ = false;
murdererTime_ = 0;
criminalTime_ = 0;
***************
*** 1632,1639 ****
SET_INT_PROPERTY( "stealthedsteps", stealthedSteps_ )
/*
! \property char.runningsteps This integer property indicates how many steps the character is running so far.
*/
! else
! SET_INT_PROPERTY( "runningsteps", runningSteps_ )
/*
\property char.tamed This boolean property indicates whether the character is tamed or not.
--- 1632,1641 ----
SET_INT_PROPERTY( "stealthedsteps", stealthedSteps_ )
/*
! \property char.running This boolean property indicates whether this character was running when he made his last step.
*/
! else if (name == "running") {
! setRunning( value.toInt() != 0 );
! return 0;
! }
/*
\property char.tamed This boolean property indicates whether the character is tamed or not.
***************
*** 1985,1989 ****
PY_PROPERTY( "creationdate", creationDate_.toString() )
PY_PROPERTY( "stealthedsteps", stealthedSteps_ )
! PY_PROPERTY( "runningsteps", runningSteps_ )
PY_PROPERTY( "tamed", isTamed() )
PY_PROPERTY( "guarding", guarding_ )
--- 1987,1991 ----
PY_PROPERTY( "creationdate", creationDate_.toString() )
PY_PROPERTY( "stealthedsteps", stealthedSteps_ )
! PY_PROPERTY( "running", running_ )
PY_PROPERTY( "tamed", isTamed() )
PY_PROPERTY( "guarding", guarding_ )
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** basechar.h 29 Aug 2004 20:40:50 -0000 1.82
--- basechar.h 31 Aug 2004 15:18:25 -0000 1.83
***************
*** 390,394 ****
uint regenManaTime() const;
cTerritory* region() const;
! uint runningSteps() const;
ushort saycolor() const;
uint skillDelay() const;
--- 390,394 ----
uint regenManaTime() const;
cTerritory* region() const;
! bool running() const;
ushort saycolor() const;
uint skillDelay() const;
***************
*** 472,476 ****
void setRegenManaTime( uint data );
void setRegion( cTerritory* data );
! void setRunningSteps( uint data );
void setSaycolor( ushort data );
void setSkillDelay( uint data );
--- 472,476 ----
void setRegenManaTime( uint data );
void setRegion( cTerritory* data );
! void setRunning( bool data );
void setSaycolor( ushort data );
void setSkillDelay( uint data );
***************
*** 782,786 ****
// Saves the number of steps the char ran.
! uint runningSteps_;
// Time, till murderer flag disappears. cOldChar::murderrate_
--- 782,786 ----
// Saves the number of steps the char ran.
! bool running_;
// Time, till murderer flag disappears. cOldChar::murderrate_
***************
*** 1179,1190 ****
}
! inline uint cBaseChar::runningSteps() const
{
! return runningSteps_;
}
! inline void cBaseChar::setRunningSteps( uint data )
{
! runningSteps_ = data;
}
--- 1179,1190 ----
}
! inline bool cBaseChar::running() const
{
! return running_;
}
! inline void cBaseChar::setRunning( bool data )
{
! running_ = data;
}
|