I've been poking around with the shockwaveDeath source and tried making my own. I discovered that the plugin can fire ShockWave world weapons from rogues but not from any other team because BZF would crash. Can anyone explain?
Edit: I tried it again, recently. It wouldn't work with Rogues either. What causes BZF to crash?
ShockWave Death from Player = Crash?
ShockWave Death from Player = Crash?
Last edited by Theme97 on Fri Mar 24, 2006 4:17 am, edited 1 time in total.
- RPG
- Lieutenant, Junior Grade
- Posts: 2015
- Joined: Fri Sep 17, 2004 2:37 am
- Location: Chicago, Illinois
- Contact:
What version of BZFS and what version client are you using? What OS? Does the original ShockwaveDeath plugin cause it to crash, or is it your modified one that is making it crash?
Before you try anything though, the most common source of plugin crashes is caused by not checking for NULL player records before using them. If you use the function bz_getPlayerByIndex, then you MUST check the return data to make sure it is not NULL. Because if it is NULL, your plugin will crash. A simple way to do it is like this:
Before you try anything though, the most common source of plugin crashes is caused by not checking for NULL player records before using them. If you use the function bz_getPlayerByIndex, then you MUST check the return data to make sure it is not NULL. Because if it is NULL, your plugin will crash. A simple way to do it is like this:
Code: Select all
bz_PlayerRecord *data = bz_getPlayerByIndex(i);
if(data){
//Stuff goes here
}
//Also free the player record to prevent memory leaks
bz_freePlayerRecord(data);
Happy Tanker is hosting it with 2.0.5b5 on Linux. The client versions 2.0.2, 2.0.4, 2.0.5b4, and 2.0.5b5 seem to crash. With the original shockwaveDeath plugin, simply add the "usevictim" parameter. Everyone except the person who died crashes. My modified version uses:
Code: Select all
void SWDeath::process ( bz_EventData *eventData )
{
bz_PlayerDieEventData *dieData = (bz_PlayerDieEventData*)eventData;
float reloadTime = (float)bz_getBZDBDouble("_reloadTime");
bz_fireWorldWep("SW",reloadTime,dieData->playerID,dieData->pos,0,0,0,0.0f);
}