mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
Stripped down version of #1818. No new features. Refactors IsPossibleTarget in AttackersValue.cpp to a better style and makes sure pets don't attack in prohibited zones. Testing: Confirmed that aggro pets no longer attack in PVP prohibited areas, but still do outside them. Zim'Torga in Zul'Drak is a good example to test this (ID 4323). Lookout for death knights with a Risen Ally (uncontrolled and naturally aggro) now they respect PVP prohibition like their master. Note: If you manually teleport a bot that is in mid combat to a PVP prohibited area, its aggro pet might still attack, because its master is still in combat strategy. Otherwise the pet will not attack if its master has switched to non-combat.
NEW MODULE - SQL BEST PRACTICES
Create a new table
Example:
CREATE TABLE IF NOT EXISTS `table`(
`id` int(11) unsigned NOT NULL,
`column` smallint(6) unsigned,
`active` BOOLEAN DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Boolean datatype in mysql:
Use TinyInt(1) or Boolean (this is the same thing)
bit(1) can also work, but it may require a syntax like b'(0) and b'(1) when inserting (not sure).
If there are multiple booleans in the same table, bit(1) is better, otherwise it's the same result.
Rules
- Use
InnoDBas engine for dynamic tables (most likely in theauthandcharactersdatabases). - Use
MyISAMfor read-only tables (inworlddatabase), but if you're not sure, just use innoDB. - Use
utf8as charset.