This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/tech/library/has.inc

22 lines
523 B
PHP

<?php
class beta5_tech_has {
function beta5_tech_has($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Checks whether a player has researched a technology
function run($pid, $rid, $bt = false) {
$cond = $bt ? "p.points >= (75 * r.points / 100)" : "p.points = r.points";
$qs = "SELECT ($cond) FROM research_player p, research r ";
$qs .= "WHERE p.player = $pid AND r.id=p.research AND r.id=$rid";
$q = $this->db->query($qs);
list($r) = dbFetchArray($q);
return ($r == "t");
}
}
?>