mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
added id field on monsters, so you can delete in phpmyadmin
fixed adding some creatures with ' and "
This commit is contained in:
3
system/migrations/4.php
Normal file
3
system/migrations/4.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `id` int(11) NOT NULL AUTO_INCREMENT primary key FIRST;");
|
||||
?>
|
@@ -505,7 +505,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
||||
if($mostdmg)
|
||||
{
|
||||
$mostdmg = ($death['mostdamage_is_player']) ? getPlayerLink($death['mostdamage_by']) : $death['mostdamage_by'];
|
||||
$dead_add_content .= '<br>and by ' . $mostdmg;
|
||||
$dead_add_content .= ' and by ' . $mostdmg;
|
||||
|
||||
if ($death['mostdamage_unjustified']) {
|
||||
$dead_add_content .= " <font color='red' style='font-style: italic;'>(unjustified)</font>";
|
||||
|
@@ -135,9 +135,15 @@ if(isset($_POST['reload_monsters']) && $canEdit)
|
||||
$flags['convinceable'] = '0';
|
||||
|
||||
if(!in_array($name, $names_added)) {
|
||||
try { $db->query("INSERT INTO myaac_monsters (hide_creature, name, mana, exp, health, speed_lvl, use_haste, voices, immunities, summonable, convinceable, race, gfx_name, file_path) VALUES (0, '".$name."', '".$mana."', '".$exp."', '".$health."', '".$speed_lvl."', '".$use_haste."', '".$voices_string."', '".$immunities_string."', '".$flags['summonable']."', '".$flags['convinceable']."', '".$race."', '".$gfx_name."', '" . $allmonsters->currentFile() . "')"); } catch(PDOException $error) {}
|
||||
try {
|
||||
$db->query("INSERT INTO myaac_monsters (hide_creature, name, mana, exp, health, speed_lvl, use_haste, voices, immunities, summonable, convinceable, race, gfx_name, file_path) VALUES (0, ".$db->quote($name).", '".$mana."', '".$exp."', '".$health."', '".$speed_lvl."', '".$use_haste."', ".$db->quote($voices_string).", ".$db->quote($immunities_string).", '".$flags['summonable']."', '".$flags['convinceable']."', '".$race."', ".$db->quote($gfx_name).", " . $db->quote($allmonsters->currentFile()) . ")");
|
||||
echo "Added: ".$name."<br/>";
|
||||
}
|
||||
catch(PDOException $error) {
|
||||
echo 'Error while adding monster (' . $name . '): ' . $error->getMessage();
|
||||
}
|
||||
|
||||
$names_added[] = $name;
|
||||
echo "Added: ".$name."<br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user