Talk:Simulated Bullets: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 9: | Line 9: | ||
:How are you calling AddBullet? Is the parameter on the heap or stack? By the way, since CSimulatedBullet has dynamically-allocated members, you need a non-default copy constructor and copy assignment operator; otherwise you'll have leaks and possibly crashes if a CSimulatedBullet is ever copied. If it's never going to be copied, make the copy constructor and copy assignment operator private and undefined. —'''[[User:Maven|Maven]]''' <sup>([[User talk:Maven|talk]])</sup> 11:31, 23 Nov 2005 (PST) | :How are you calling AddBullet? Is the parameter on the heap or stack? By the way, since CSimulatedBullet has dynamically-allocated members, you need a non-default copy constructor and copy assignment operator; otherwise you'll have leaks and possibly crashes if a CSimulatedBullet is ever copied. If it's never going to be copied, make the copy constructor and copy assignment operator private and undefined. —'''[[User:Maven|Maven]]''' <sup>([[User talk:Maven|talk]])</sup> 11:31, 23 Nov 2005 (PST) | ||
I've tried a copy constructor b4... | |||
<pre> Vector vecSrc(info.m_vecSrc); | |||
CSimulatedBullet *pBullet = new CSimulatedBullet(pAttacker, info.m_pAdditionalIgnoreEnt, | |||
info.m_iAmmoType, info.m_nFlags, vecDir, vecSrc, nDamageType | |||
#ifndef CLIENT_DLL | |||
, this, info.m_iDamage, 0.0f | |||
#endif | |||
); | |||
BulletManager()->AddBullet(pBullet);</pre> | |||
—'''[[User:Ts2do|ts2do]]''' <sup>([[User talk:Ts2do|Talk]] | [mailto:tsdodo@gmail.com @])</sup> 11:43, 23 Nov 2005 (PST) |
Revision as of 12:43, 23 November 2005
I'd really like assistance with this if anyone can do any implementation of this or any fixes to the bullet simulator... implementation includes making the gun shoot them out, making the bullets hurt, and making clientside effects... I have a feeling that other mods WILL want to use timed bullets, and this code will do the trick... I just need help (or plenty of time) getting it finished first and then it will be available to everyone!—ts2do (Talk | @) 23:06, 20 Nov 2005 (PST)
- Yes ts2do (you went away before i came back), the myth was busted, best to contact Wrayith at Nightfall mod for more info. He was interested, and was implementing something like this with the quake 2 code, and was going to port it to hl2 latter. MSN wraiyth@gmail.com --Amckern 01:07, 21 Nov 2005 (PST)
Does anyone know what it means if I'm getting this sort of error on the client:
client.dll!CUtlMemory<CSimulatedBullet *>::Base() Line 252 + 0x3 client.dll!CUtlVector<CSimulatedBullet *,CUtlMemory<CSimulatedBullet *> >::Base() Line 54 + 0x14 client.dll!CUtlVector<CSimulatedBullet *,CUtlMemory<CSimulatedBullet *> >::AddToTail(CSimulatedBullet * const & src=0x044fc440) Line 403 + 0x8
It seems to not like me adding an item to the utlvector on the client but it's fine with it on the server —ts2do (Talk | @) 10:52, 23 Nov 2005 (PST)
- How are you calling AddBullet? Is the parameter on the heap or stack? By the way, since CSimulatedBullet has dynamically-allocated members, you need a non-default copy constructor and copy assignment operator; otherwise you'll have leaks and possibly crashes if a CSimulatedBullet is ever copied. If it's never going to be copied, make the copy constructor and copy assignment operator private and undefined. —Maven (talk) 11:31, 23 Nov 2005 (PST)
I've tried a copy constructor b4...
Vector vecSrc(info.m_vecSrc); CSimulatedBullet *pBullet = new CSimulatedBullet(pAttacker, info.m_pAdditionalIgnoreEnt, info.m_iAmmoType, info.m_nFlags, vecDir, vecSrc, nDamageType #ifndef CLIENT_DLL , this, info.m_iDamage, 0.0f #endif ); BulletManager()->AddBullet(pBullet);