Skip to content

Commit

Permalink
6/21/2008 - giwo (0.98-3.7s)
Browse files Browse the repository at this point in the history
	Modified UString to function without crashing under VS2008
	Fixed a bug in CItem::RemoveFromSight() causing items inside containers on the ground not to properly notify nearby players when removed.
	Fixed a bug in CPIDropItem() when the compiler does not automatically instantiate booleans to false
  • Loading branch information
giwo committed Jun 21, 2008
1 parent 674a4c1 commit f259f6a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
1 change: 1 addition & 0 deletions source/CPacketReceive.cpp
Expand Up @@ -1141,6 +1141,7 @@ CPIDropItem::CPIDropItem( CSocket *s ) : CPInputBuffer( s )
}
void CPIDropItem::Receive( void )
{
uokrFlag = false;
if( tSock->ClientType() == CV_UOKR )
uokrFlag = true;

Expand Down
5 changes: 5 additions & 0 deletions source/Changelog.txt
@@ -1,3 +1,8 @@
6/21/2008 - giwo (0.98-3.7s)
Modified UString to function without crashing under VS2008
Fixed a bug in CItem::RemoveFromSight() causing items inside containers on the ground not to properly notify nearby players when removed.
Fixed a bug in CPIDropItem() when the compiler does not automatically instantiate booleans to false

6/21/2008 - giwo
Fixed several issues with tracking.
Fixed a crash caused by passing an invalid object to the JS Method TurnToward
Expand Down
9 changes: 6 additions & 3 deletions source/cItem.cpp
Expand Up @@ -1748,7 +1748,11 @@ void CItem::RemoveFromSight( CSocket *mSock )
mSock->Send( &toRemove );
else
{
SOCKLIST nearbyChars = FindPlayersInOldVisrange( this );
SOCKLIST nearbyChars;
if( rItem == this )
nearbyChars = FindPlayersInOldVisrange( rItem );
else
nearbyChars = FindPlayersInVisrange( rItem );
for( SOCKLIST_CITERATOR cIter = nearbyChars.begin(); cIter != nearbyChars.end(); ++cIter )
{
if( !(*cIter)->LoginComplete() )
Expand Down Expand Up @@ -1843,11 +1847,10 @@ void CItem::Cleanup( void )
{
JSEngine->ReleaseObject( IUE_ITEM, this );

RemoveSelfFromCont();

CBaseObject::Cleanup();

RemoveFromSight();
RemoveSelfFromCont();
RemoveSelfFromOwner();

for( CItem *tItem = Contains.First(); !Contains.Finished(); tItem = Contains.Next() )
Expand Down
2 changes: 1 addition & 1 deletion source/cVersionClass.cpp
@@ -1,4 +1,4 @@
//o--------------------------------------------------------------------------o
//o--------------------------------------------------------------------------o
//| Function/Class -
//| Date - 10/17/2002
//| Developer(s) - EviLDeD
Expand Down
2 changes: 1 addition & 1 deletion source/skills.cpp
Expand Up @@ -1320,7 +1320,7 @@ void cSkills::CreateTrackingMenu( CSocket *s, UI16 m )
if( ( !tempChar->isHuman() || creatureType == CT_PERSON ) && ( !cwmWorldState->creatures[id].IsAnimal() || creatureType == CT_ANIMAL ) )
{
const bool cmdLevelCheck = ( isOnline( (*tempChar) ) && ( mChar->GetCommandLevel() >= tempChar->GetCommandLevel() ) );
if( tempChar != mChar && objInRange( tempChar, mChar, static_cast<UI16>(distance) ) && !tempChar->IsDead() && ( cmdLevelCheck || tempChar->IsNpc() ) )
if( tempChar != mChar && objInRange( tempChar, mChar, distance ) && !tempChar->IsDead() && ( cmdLevelCheck || tempChar->IsNpc() ) )
{
mChar->SetTrackingTargets( tempChar, MaxTrackingTargets );
++MaxTrackingTargets;
Expand Down
5 changes: 2 additions & 3 deletions source/ustring.cpp
Expand Up @@ -416,15 +416,14 @@ UString UString::number ( unsigned int n, int base )
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UString UString::lower() const
{
UString sReturn = *this;
UString sReturn(this->c_str());
std::transform(sReturn.begin(), sReturn.end(), sReturn.begin(), ::tolower);
return ( sReturn );
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UString UString::upper() const
{
UString sReturn = *this;

UString sReturn(this->c_str());
std::transform(sReturn.begin(), sReturn.end(), sReturn.begin(), ::toupper);
return ( sReturn );
}
Expand Down
14 changes: 7 additions & 7 deletions source/ustring.h
@@ -1,11 +1,11 @@
#ifndef __STRING_H
#define __STRING_H
#ifndef __USTRING_H
#define __USTRING_H
// Ssytem Includes
#include <string>
#include <cstdarg>
#include <cstdio>
#include "stream.h"
#include <algorithm>
//#include <string>
//#include <cstdarg>
//#include <cstdio>
//#include "stream.h"
//#include <algorithm>


typedef std::string stdstring ;
Expand Down

0 comments on commit f259f6a

Please sign in to comment.