From: <ac...@us...> - 2007-12-01 03:51:46
|
Revision: 327 http://planeshift.svn.sourceforge.net/planeshift/?rev=327&view=rev Author: acraig Date: 2007-11-30 19:51:51 -0800 (Fri, 30 Nov 2007) Log Message: ----------- FS#594 - wrong body color (texture) when unwielding torso armor on kran Modified Paths: -------------- trunk/docs/history.txt trunk/src/client/charapp.cpp trunk/src/client/gui/pawscharpick.cpp trunk/src/server/creationmanager.cpp Modified: trunk/docs/history.txt =================================================================== --- trunk/docs/history.txt 2007-12-01 01:19:08 UTC (rev 326) +++ trunk/docs/history.txt 2007-12-01 03:51:51 UTC (rev 327) @@ -1,3 +1,7 @@ +*** 2007-12-01 by Andrew Craig +- FS#594 - wrong body color (texture) when unwielding torso armor on kran. +- Cleaned up some error handling when tutorial not found. + *** 2007-11-29 by Roland Schulz - add position saving for eedit widgets as requested in FS#641 Modified: trunk/src/client/charapp.cpp =================================================================== --- trunk/src/client/charapp.cpp 2007-12-01 01:19:08 UTC (rev 326) +++ trunk/src/client/charapp.cpp 2007-12-01 03:51:51 UTC (rev 327) @@ -364,7 +364,6 @@ csString& subMesh, csString& texture) { - if ( slotname == "head" ) { ShowHair(true); @@ -379,21 +378,21 @@ if ( subMesh.Length() ) { - printf("Setting Default Mesh on %s\n", part.GetData()); DefaultMesh(part); } + if ( part.Length() ) { if ( texture.Length() ) { ChangeMaterial(part, texture, texture); } - else + else { DefaultMaterial(part); } - DefaultMesh(part); + DefaultMaterial(part); } return true; @@ -407,13 +406,11 @@ for (int idx=0; idx < stateFactory->GetMeshCount(); idx++) { const char * meshName = stateFactory->GetMeshName( idx ); - printf("Part: %s Mesh %d = %s\n", part, idx, meshName ); if (strstr(meshName, part)) { state->DetachCoreMesh( meshName ); if (stateFactory->IsMeshDefault(idx)) { - printf("This is default mesh\n"); defaultPart = meshName; } } @@ -675,19 +672,26 @@ void psCharAppearance::DefaultMaterial(csString& part) -{ +{ + bool torsoFound = false; + for ( size_t z = 0; z < skinToneSet.GetSize(); z++ ) { + if ( skinToneSet[z].part == "Torso" ) + { + torsoFound = true; + } + if ( part == skinToneSet[z].part ) { ChangeMaterial(part, skinToneSet[z].material, skinToneSet[z].texture); } } - - if ( part == "Torso" ) + + if ( part == "Torso" && torsoFound == false) { ChangeMaterial(part, stateFactory->GetDefaultMaterial(part), stateFactory->GetDefaultMaterial(part)); - } + } } Modified: trunk/src/client/gui/pawscharpick.cpp =================================================================== --- trunk/src/client/gui/pawscharpick.cpp 2007-12-01 01:19:08 UTC (rev 326) +++ trunk/src/client/gui/pawscharpick.cpp 2007-12-01 03:51:51 UTC (rev 327) @@ -551,7 +551,7 @@ csString traits(models[selectedCharacter].traits); csString equipment( models[selectedCharacter].equipment ); - charApp->SetMesh(view->GetObject()); + charApp->SetMesh(view->GetObject()); charApp->ApplyTraits(traits); charApp->ApplyEquipment(equipment); Modified: trunk/src/server/creationmanager.cpp =================================================================== --- trunk/src/server/creationmanager.cpp 2007-12-01 01:19:08 UTC (rev 326) +++ trunk/src/server/creationmanager.cpp 2007-12-01 03:51:51 UTC (rev 327) @@ -824,7 +824,7 @@ chardata->SetRaceInfo(raceinfo); chardata->SetHitPoints(50.0); chardata->SetHitPointsMax(0.0); - chardata->SetHitPointsMaxModifier(0.0); + chardata->SetHitPointsMaxModifier(0.0); // Try tutorial level first. const char* sectorname = "tutorial"; @@ -834,21 +834,36 @@ float yrot = 4.0f; psSectorInfo *sectorinfo = CacheManager::GetSingleton().GetSectorInfoByName(sectorname); - if (!sectorinfo) + + bool sectorFound = true; + + if ( sectorinfo && EntityManager::GetSingleton().FindSector(sectorinfo->name) == NULL ) { - // Now try the raceinfo starting location. - raceinfo->GetStartingLocation(x,y,z,yrot,sectorname); - sectorinfo = CacheManager::GetSingleton().GetSectorInfoByName(sectorname); - if (!sectorinfo) - { - Error2("Unresolvable starting sector='%s'", sectorname ); - psCharRejectedMessage reject(me->clientnum); - psserver->GetEventManager()->Broadcast(reject.msg, NetBase::BC_FINALPACKET); - psserver->RemovePlayer (me->clientnum,"No starting Sector."); - delete chardata; - return; - } + Error2("Sector='%s' found but no map file was detected for it. Using NPCroom1", sectorname ); + sectorinfo = CacheManager::GetSingleton().GetSectorInfoByName("NPCroom1"); + if ( sectorinfo && EntityManager::GetSingleton().FindSector(sectorinfo->name) == NULL ) + { + Error1("NPCroom1 failed - Critical"); + sectorFound = false; + } } + else + { + sectorFound = false; + } + + + if ( sectorFound == false ) + { + Error2("Unresolvable starting sector='%s'", sectorname ); + psCharRejectedMessage reject(me->clientnum); + psserver->GetEventManager()->Broadcast(reject.msg, NetBase::BC_FINALPACKET); + psserver->RemovePlayer (me->clientnum,"No starting Sector."); + delete chardata; + return; + } + + uint32 newinstance = psserver->GetRandom(INT_MAX-1)+1; chardata->SetLocationInWorld(newinstance, sectorinfo, x, y, z, yrot); // Chars will start on random instance @@ -874,7 +889,10 @@ trait = CacheManager::GetSingleton().GetTraitByID(upload.selectedSkinColour); if ( trait ) chardata->SetTraitForLocation( trait->location, trait ); - + + printf("Uploaded Skin Colour: %d\n", upload.selectedSkinColour ); + + csString filename; filename.Format("/planeshift/models/%s/%s.cal3d",raceinfo->mesh_name,raceinfo->mesh_name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |