<commit_before>// shockwaveDeath.cpp : Defines the entry point for the DLL application.
//

#include "bzfsAPI.h"
#include <string>

BZ_GET_PLUGIN_VERSION

// event handler callback
class DeathHandler : public bz_EventHandler
{
public:
	virtual void process ( bz_EventData *eventData );

	bool	usePlayerForShot;
};

DeathHandler	deathHandler;

BZF_PLUGIN_CALL int bz_Load ( const char* commandLine )
{
	bz_debugMessage(4,"shockwaveDeath plugin loaded");

	bz_registerEvent(bz_ePlayerDieEvent,&deathHandler);

	std::string param = commandLine;

	deathHandler.usePlayerForShot = (param == "usevictim");
	return 0;
}

BZF_PLUGIN_CALL int bz_Unload ( void )
{
	bz_removeEvent(bz_ePlayerDieEvent,&deathHandler);
	bz_debugMessage(4,"shockwaveDeath plugin unloaded");
	return 0;
}

void DeathHandler::process ( bz_EventData *eventData )
{
	if (eventData->eventType != bz_ePlayerDieEvent)
		return;

	bz_PlayerDieEventData	*dieData = (bz_PlayerDieEventData*)eventData;

	int playerToUse = BZ_SERVER;
	if ( usePlayerForShot )
		playerToUse = dieData->playerID;

        
	bz_fireWorldWep("SW",(float)bz_getBZDBDouble("_reloadTime"),playerToUse,dieData->pos,0,0,0,0.0f);
}

<commit_msg>chec for _swDeathReloadFactor when computing the lifetime<commit_after>// shockwaveDeath.cpp : Defines the entry point for the DLL application.
//

#include "bzfsAPI.h"
#include <string>

BZ_GET_PLUGIN_VERSION

// event handler callback
class DeathHandler : public bz_EventHandler
{
public:
	virtual void process ( bz_EventData *eventData );

	bool	usePlayerForShot;
};

DeathHandler	deathHandler;

BZF_PLUGIN_CALL int bz_Load ( const char* commandLine )
{
	bz_debugMessage(4,"shockwaveDeath plugin loaded");

	bz_registerEvent(bz_ePlayerDieEvent,&deathHandler);

	std::string param = commandLine;

	deathHandler.usePlayerForShot = (param == "usevictim");
	return 0;
}

BZF_PLUGIN_CALL int bz_Unload ( void )
{
	bz_removeEvent(bz_ePlayerDieEvent,&deathHandler);
	bz_debugMessage(4,"shockwaveDeath plugin unloaded");
	return 0;
}

void DeathHandler::process ( bz_EventData *eventData )
{
	if (eventData->eventType != bz_ePlayerDieEvent)
		return;

	bz_PlayerDieEventData	*dieData = (bz_PlayerDieEventData*)eventData;

	int playerToUse = BZ_SERVER;
	if ( usePlayerForShot )
		playerToUse = dieData->playerID;

	float reloadTime = (float)bz_getBZDBDouble("_reloadTime");

	if (bz_BZDBItemExists("_swDeathReloadFactor") && bz_getBZDBDouble("_swDeathReloadFactor") > 0)
		reloadTime *= (float)bz_getBZDBDouble("_swDeathReloadFactor");
        
	bz_fireWorldWep("SW",reloadTime,playerToUse,dieData->pos,0,0,0,0.0f);
}


{'fraction_non_alphanumeric': 0.10587326120556415, 'fraction_numerical': 0.007341576506955177, 'mean_word_length': 6.292957746478873, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5514137', 'n_tokens_mistral': 998, 'n_tokens_neox': 926, 'n_words': 173}