Thread: VoA Stuff
View Single Post
  #4  
Old 02-10-2012, 06:54 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I moved your posts to their own thread. The thread titled "Sticky: Post Your New Code Here!" doesn't literally mean to post submissions in that thread. I locked that thread so it doesn't happen again.

Unfortunately, unless you can provide a diff of what you did, your code in this thread will probably just be ignored. We can't tell what you changed without spending a ton of time to figure out where everything should go. If you post a diff, it will make more sense.

If you use TortoiseSVN for getting your source code, then posting a diff is VERY easy. Just right click on your EQEmuServer folder and select TortoiseSVN->Create Patch...

Then, select the files you want to show in your patch diff and click OK. You then have the option to save your diff, but the easiest thing to do is click Save to clipboard.

Then start a post on this forum and click the # button above your post window where the B I U buttons and such are. Then just press CTRL+V to paste your code diff.

The code boxes are done like this

\[CODE\]Here is where you put code\[/CODE\]
Without the \ slashes.

Here is an example of what it should look like:

Code:
Index: changelog.txt
===================================================================
--- changelog.txt	(revision 2099)
+++ changelog.txt	(working copy)
@@ -1,5 +1,8 @@
 EQEMu Changelog (Started on Sept 24, 2003 15:50)
 -------------------------------------------------------
+==02/10/2012==
+Trevius: Look, I made a change!
+
 ==02/03/2012==
 Trevius: Added accout_status field to the discovered_items table to make it easier to remove accidental GM item discovery from the table.
 
Index: zone/entity.cpp
===================================================================
--- zone/entity.cpp	(revision 2097)
+++ zone/entity.cpp	(working copy)
@@ -4453,12 +4453,12 @@
 
 void EntityList::SignalAllClients(int32 data)
 {
-	LinkedListIterator<Client*> iterator(client_list); 
+	LinkedListIterator<Client*> iterator(client_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		Client *ent = iterator.GetData();
-		if(ent)
+		if (ent->CastToClient() && ent->CastToClient()->Connected())
 		{
 			ent->Signal(data);
 		}
@@ -4469,12 +4469,15 @@
 void EntityList::GetMobList(list<Mob*> &m_list)
 {
 	m_list.clear();
-	LinkedListIterator<Mob*> iterator(mob_list); 
+	LinkedListIterator<Mob*> iterator(mob_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		Mob *ent = iterator.GetData();
-		m_list.push_back(ent);
+		if (!ent->IsClient() || (ent->IsClient() && ent->CastToClient() && ent->CastToClient()->Connected()))
+		{
+			m_list.push_back(ent);
+		}
 		iterator.Advance();
 	}
 }
@@ -4482,12 +4485,15 @@
 void EntityList::GetNPCList(list<NPC*> &n_list)
 {
 	n_list.clear();
-	LinkedListIterator<NPC*> iterator(npc_list); 
+	LinkedListIterator<NPC*> iterator(npc_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		NPC *ent = iterator.GetData();
-		n_list.push_back(ent);
+		if (ent->GetHP() > 0)
+		{
+			n_list.push_back(ent);
+		}
 		iterator.Advance();
 	}
 }
@@ -4495,12 +4501,15 @@
 void EntityList::GetClientList(list<Client*> &c_list)
 {
 	c_list.clear();
-	LinkedListIterator<Client*> iterator(client_list); 
+	LinkedListIterator<Client*> iterator(client_list);
 	iterator.Reset();
-	while(iterator.MoreElements()) 
+	while(iterator.MoreElements())
 	{
 		Client *ent = iterator.GetData();
-		c_list.push_back(ent);
+		if (ent->CastToClient() && ent->CastToClient()->Connected())
+		{
+			c_list.push_back(ent);
+		}
 		iterator.Advance();
 	}
 }
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 02-10-2012 at 07:07 PM..
Reply With Quote