diff --git a/TPCPatchMap.php b/TPCPatchMap.php index 1f32499..ff03492 100644 --- a/TPCPatchMap.php +++ b/TPCPatchMap.php @@ -83,9 +83,6 @@ public static function get( $title ) { ); } - /** - * @return bool true if mapping was updated - */ public static function update( $title, $patch, $game = null, $target = null ) { $map = self::get( $title ); $patches = self::mergePatch( $map, $patch ); @@ -96,10 +93,9 @@ public static function update( $title, $patch, $game = null, $target = null ) { ( TPCUtil::dictGet( $map->pm_game ) === $game ) and ( TPCUtil::dictGet( $map->pm_target ) === $target ) ) { - return false; + return; } self::updateMapping( $title, $patches, $game, $target ); - return true; } /** diff --git a/hooks/TPCInclude.php b/hooks/TPCInclude.php index 713a2fe..f5256da 100644 --- a/hooks/TPCInclude.php +++ b/hooks/TPCInclude.php @@ -47,14 +47,12 @@ public static function onTarget( &$tpcState, $title, &$temp, $patch = null ) { $file = TPCUtil::dictGet( $temp->params['target'] ); } - $titleID = $title->getArticleID(); - if ( !$patch ) { $patch = $tpcState->patches[0]; } - $parse = TPCPatchMap::update( $title, $patch, $game, $file ); - if ( $parse and $titleID ) { + TPCPatchMap::update( $title, $patch, $game, $file ); + if ( $title->getArticleID() ) { TouhouPatchCenter::evalTitle( $title ); } return true;